Skip to content

Commit

Permalink
[MIG] account_invoice_report_due_list: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dsolanki-initos committed Jul 7, 2023
1 parent f5c0ea3 commit f285e62
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 16 deletions.
2 changes: 2 additions & 0 deletions account_invoice_report_due_list/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ Contributors

* David Alonso

* Dhara Solanki <[email protected]>

Maintainers
~~~~~~~~~~~

Expand Down
2 changes: 1 addition & 1 deletion account_invoice_report_due_list/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"name": "Account Invoice Report Due List",
"summary": "Show multiple due data in invoice",
"version": "15.0.2.0.1",
"version": "16.0.1.0.0",
"category": "Accounting",
"website": "https://github.com/OCA/account-invoice-reporting",
"author": "Tecnativa, Odoo Community Association (OCA)",
Expand Down
6 changes: 3 additions & 3 deletions account_invoice_report_due_list/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ def _compute_multi_date_due(self):
def get_multi_due_list(self):
self.ensure_one()
if "in_" in self.move_type:
internal_type = "payable"
account_type = "liability_payable"

Check warning on line 31 in account_invoice_report_due_list/models/account_move.py

View check run for this annotation

Codecov / codecov/patch

account_invoice_report_due_list/models/account_move.py#L31

Added line #L31 was not covered by tests
elif "out_" in self.move_type:
internal_type = "receivable"
account_type = "asset_receivable"
else:
return []

Check warning on line 35 in account_invoice_report_due_list/models/account_move.py

View check run for this annotation

Codecov / codecov/patch

account_invoice_report_due_list/models/account_move.py#L35

Added line #L35 was not covered by tests
due_move_line_ids = self.line_ids.filtered(
lambda ml: ml.account_id.internal_type == internal_type
lambda ml: ml.account_id.account_type == account_type
)
if self.currency_id == self.company_id.currency_id:
amount_field = "balance"
Expand Down
2 changes: 2 additions & 0 deletions account_invoice_report_due_list/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
* `Solvos <https://www.solvos.es>`_:

* David Alonso

* Dhara Solanki <[email protected]>
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@ def setUpClass(cls):
"value": "percent",
"value_amount": 25.0,
"days": 30,
"sequence": 10,
},
),
(0, 0, {"value": "balance", "days": 60, "sequence": 20}),
(0, 0, {"value": "balance", "days": 60}),
],
}
)
Expand All @@ -51,17 +50,15 @@ def setUpClass(cls):
{
"name": "Test Account",
"code": "TEST",
"user_type_id": cls.env.ref("account.data_account_type_receivable").id,
"account_type": "asset_receivable",
"reconcile": True,
}
)
cls.other_account = cls.env["account.account"].create(
{
"name": "Test Account",
"code": "ACC",
"user_type_id": cls.env.ref(
"account.data_account_type_other_income"
).id,
"account_type": "liability_payable",
"reconcile": True,
}
)
Expand Down Expand Up @@ -96,7 +93,7 @@ def test_due_list(self, move_type="out_invoice"):
res = (
self.env["ir.actions.report"]
._get_report_from_name("account.report_invoice")
._render_qweb_html(invoice.ids)
._render_qweb_html("account.report_invoice", invoice.ids)
)
self.assertRegex(str(res[0]), date_due_format)
self.assertRegex(str(res[0]), "75.0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<record id="view_move_form" model="ir.ui.view">
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form" />
<field name="groups_id" eval="[(4, ref('account.group_account_invoice'))]" />
<field name="arch" type="xml">
<xpath expr="//field[@name='invoice_payment_term_id']/.." position="after">
<field name="multi_due" invisible="1" />
Expand Down
5 changes: 1 addition & 4 deletions account_invoice_report_due_list/views/report_invoice.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
<xpath expr="//p[@t-field='o.invoice_date_due']/.." position="attributes">
<attribute name="class" add="d-none" separator=" " />
</xpath>
<xpath
expr="//span[@t-field='o.invoice_payment_term_id.note']"
position="after"
>
<xpath expr="//div[@t-field='o.invoice_payment_term_id.note']" position="after">
<t t-set="due_list" t-value="o.get_multi_due_list()" />
<div class="row" t-if="due_list" style="page-break-inside: avoid;">
<div class="col-4">
Expand Down

0 comments on commit f285e62

Please sign in to comment.