Skip to content

Commit

Permalink
[MIG] recurring_contract : forward-port changes from 14.0
Browse files Browse the repository at this point in the history
- T1695 Only activate contracts paid
- invoice_paid could be called on partially paid invoices. We add a filter to make sure the invoice is totally paid before activating a contract.
  • Loading branch information
ecino committed Sep 10, 2024
1 parent edd60b2 commit e1ebe63
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion recurring_contract/models/move.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def _get_bank_statement_notes(self):
def _invoice_paid_hook(self):
"""Call invoice_paid method on related contracts."""
res = super()._invoice_paid_hook()
for invoice in self:
for invoice in self.filtered(lambda i: i.payment_state == "paid"):
contracts = invoice.mapped("invoice_line_ids.contract_id")
contracts.invoice_paid(invoice)
return res
Expand Down

0 comments on commit e1ebe63

Please sign in to comment.