From 800003904afaaa8790503437fe7d4617c4c3562a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dar=C3=ADo=20Lodeiros?= Date: Mon, 24 Jun 2024 08:43:07 +0200 Subject: [PATCH] [IMP]pms: Avoid block validate invoice by auto conciliation issue --- pms/models/account_move.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pms/models/account_move.py b/pms/models/account_move.py index ffab6a17d..b193dd32d 100644 --- a/pms/models/account_move.py +++ b/pms/models/account_move.py @@ -282,8 +282,19 @@ class AccountMove(models.Model): payments=to_propose, invoice=move ) if to_reconcile: - (pay_term_lines + to_reconcile).reconcile() - + try: + (pay_term_lines + to_reconcile).reconcile() + except Exception as e: + message = ( + _( + """ + An error occurred while reconciling + the invoice with the payments: %s + """ + ) + % str(e) + ) + move.message_post(body=message) return True def _post(self, soft=True):