[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
This commit is contained in:
Paolo Gatti (pgi)
2024-03-08 12:48:55 +00:00
parent 98ff6909a7
commit 449433b73e
+3 -5
View File
@@ -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)