From 449433b73e55db83b5291c5a8bc808862dda65ca Mon Sep 17 00:00:00 2001 From: "Paolo Gatti (pgi)" Date: Fri, 16 Feb 2024 18:19:16 +0100 Subject: [PATCH] [IMP] account: EDI decoder should post in the chatter on error Added a small message in the chatter on an invoice when the invoice fails import. Silencing errors on a blank invoice doesn't help us fix issues and doesn't solve the import problem. Part-of: odoo/odoo#153556 --- addons/account/models/account_move.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 754609e7132..484706c6b5c 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -3170,11 +3170,9 @@ class AccountMove(models.Model): except RedirectWarning: raise except Exception: - _logger.exception( - "Error importing attachment '%s' as invoice (decoder=%s)", - file_data['filename'], - decoder.__name__ - ) + message = _("Error importing attachment '%s' as invoice (decoder=%s)", file_data['filename'], decoder.__name__) + invoice.sudo().message_post(body=message) + _logger.exception(message) passed_file_data_list.append(file_data) close_file(file_data)