Skip to content

Commit

Permalink
[FIX] migration to v17
Browse files Browse the repository at this point in the history
  • Loading branch information
celer committed Jun 3, 2024
1 parent bd64435 commit 630b975
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions account_move_template/wizard/account_move_template_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,12 @@ def _prepare_move(self):
def _prepare_move_line(self, line, amount):
date_maturity = False
if line.payment_term_id:
pterm_list = line.payment_term_id.compute(value=1, date_ref=self.date)
date_maturity = max(line[0] for line in pterm_list)
date_maturity = max(
[
line._get_due_date(self.date)
for line in line.payment_term_id.line_ids
]
)
debit = line.move_line_type == "dr"
values = {
"name": line.name,
Expand All @@ -225,10 +229,11 @@ def _prepare_move_line(self, line, amount):
}
if line.tax_ids:
values["tax_ids"] = [Command.set(line.tax_ids.ids)]
tax_repartition = "refund_tax_id" if line.is_refund else "invoice_tax_id"
document_type = "refund" if line.is_refund else "invoice"

Check warning on line 232 in account_move_template/wizard/account_move_template_run.py

View check run for this annotation

Codecov / codecov/patch

account_move_template/wizard/account_move_template_run.py#L232

Added line #L232 was not covered by tests
atrl_ids = self.env["account.tax.repartition.line"].search(
[
(tax_repartition, "in", line.tax_ids.ids),
("tax_id", "in", line.tax_ids.ids),
("document_type", "=", document_type),
("repartition_type", "=", "base"),
]
)
Expand Down

0 comments on commit 630b975

Please sign in to comment.