diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index c73f240da4a..9531a72baee 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -2307,6 +2307,10 @@ class AccountMove(models.Model): lambda m: m.is_invoice(include_receipts=True) and m.currency_id.is_zero(m.amount_total) ).action_invoice_paid() + # Force balance check since nothing prevents another module to create an incorrect entry. + # This is performed at the very end to avoid flushing fields before the whole processing. + self._check_balanced() + def _auto_compute_invoice_reference(self): ''' Hook to be overridden to set custom conditions for auto-computed invoice references. :return True if the move should get a auto-computed reference else False