[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) <las@odoo.com>
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user