From 622c018a654864b84b64d691baf9ab276363c45c Mon Sep 17 00:00:00 2001 From: aamo-odoo Date: Mon, 22 Apr 2024 16:26:59 +0530 Subject: [PATCH] [FIX] account: update object reference in loop In line[1], self is referenced to _get_default_mail_attachments_widget, and using self instead of wizard doesn't make sense because self could potentially hold multiple values. This becomes problematic when the ensure_one method is called. Due to this below error is raised. Traceback : ValueError Expected singleton: account.move.send(168, 167) [1] : https://github.com/odoo/odoo/blob/167dedab5c7423097689c6a7d0d6ee6dd904a8bf/addons/account/wizard/account_move_send.py#L311-L312 sentry - 5234450902 closes odoo/odoo#162829 Signed-off-by: Laurent Smet (las) --- addons/account/wizard/account_move_send.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/wizard/account_move_send.py b/addons/account/wizard/account_move_send.py index adeed994e99..434b80efdd7 100644 --- a/addons/account/wizard/account_move_send.py +++ b/addons/account/wizard/account_move_send.py @@ -307,7 +307,7 @@ class AccountMoveSend(models.TransientModel): if wizard.mode == 'invoice_single': manual_attachments_data = [x for x in wizard.mail_attachments_widget or [] if x.get('manual')] wizard.mail_attachments_widget = ( - self._get_default_mail_attachments_widget(wizard.move_ids, wizard.mail_template_id) + wizard._get_default_mail_attachments_widget(wizard.move_ids, wizard.mail_template_id) + manual_attachments_data ) else: