From 2b110f7fdeb53d07b48884dcf319e9ec47eba1ba Mon Sep 17 00:00:00 2001 From: Renilkumar Kajavadra Date: Tue, 30 May 2023 13:12:13 +0000 Subject: [PATCH] [FIX] account_edi: prevent typeerror when object is None MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If applied, this commit will solve the 'NoneType' object is not iterable when in _get_mail_attachment_from_doc function returns None. Steps to reproduce the issue: - Install Accounting and l10n_in_edi. - Go to accounting -> Configuration -> Journals -> Customer Invoices -> Advanced Settings -> Enable Electronic invoicing - Switch company to IN Company - Go to Account -> New invoice -> Add required fields -> Confirm -> Send & Print sentry-4215675843 closes odoo/odoo#124346 X-original-commit: 84bcdcf6042a7d938803c95a6e0fe06f6e22aef9 Signed-off-by: Laurent Smet Signed-off-by: William André (wan) --- addons/account_edi/wizard/account_move_send.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/account_edi/wizard/account_move_send.py b/addons/account_edi/wizard/account_move_send.py index ca4ff9cffd0..2cbd0ed4a10 100644 --- a/addons/account_edi/wizard/account_move_send.py +++ b/addons/account_edi/wizard/account_move_send.py @@ -15,6 +15,7 @@ class AccountMoveSend(models.Model): 'mimetype': attachment_sudo.mimetype, 'placeholder': False, }] + return [] def _get_default_mail_attachments_data(self, mail_template, move): """ Returns all the placeholder data and mail template data