Skip to content

Commit

Permalink
T1862 FIX payment_mode removed after contract ending
Browse files Browse the repository at this point in the history
- Because payment_mode is computed, it's recomputed when invoices are modified and not taken from the contract. With this workaround we ensure it's not changed when an invoice is modified upon contract ending.
  • Loading branch information
ecino committed Oct 1, 2024
1 parent cb2afb6 commit 037a0d6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion recurring_contract/models/recurring_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,10 @@ def _cancel_invoices(self):
)
if remaining_lines:
# We can move or remove the line
invoice.write({"invoice_line_ids": [(2, inv_line.id)]})
invoice.write({
"invoice_line_ids": [(2, inv_line.id)],
"payment_mode_id": invoice.payment_mode_id.id,
})
else:
# The invoice would be empty if we remove the line
empty_invoices |= invoice
Expand Down

0 comments on commit 037a0d6

Please sign in to comment.