diff --git a/l10n_pt_account_invoicexpress/models/account_move.py b/l10n_pt_account_invoicexpress/models/account_move.py index ad9ac463..a5fafc7a 100644 --- a/l10n_pt_account_invoicexpress/models/account_move.py +++ b/l10n_pt_account_invoicexpress/models/account_move.py @@ -369,9 +369,15 @@ def create_credit_note(self, lines): ], }) + # Post and reconcile credit note if l10npt_vat_exempt_reason: credit_note.action_post() + outstanding_lines = credit_note.line_ids + outstanding_lines = outstanding_lines.filtered(lambda l: float_compare(l.balance, 0.0, 2) < 0) + for outstanding_line in outstanding_lines: + self.js_assign_outstanding_line(outstanding_line.id) + def _track_subtype(self, init_values): res = super()._track_subtype(init_values) if "payment_state" in init_values and self.payment_state == "paid":