From bccc78a7f4d0fff283073af5e6fc2f3bac8f84a5 Mon Sep 17 00:00:00 2001 From: Hetashree Chauhan Date: Mon, 19 Aug 2019 09:45:44 +0000 Subject: [PATCH] [FIX] account_facturx: fixed traceback issue: a traceback is faced when configured a journal alias to create invoice/bill when fetching emails with a pdf file from that alias. closes odoo/odoo#34740 Task: 34740 Closes: #34740 Signed-off-by: oco-odoo --- addons/account_facturx/models/account_move.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/addons/account_facturx/models/account_move.py b/addons/account_facturx/models/account_move.py index 0941a907b33..721865d4d5d 100644 --- a/addons/account_facturx/models/account_move.py +++ b/addons/account_facturx/models/account_move.py @@ -222,15 +222,7 @@ class AccountMove(models.Model): res = super(AccountMove, self).message_post(**kwargs) if 'no_new_invoice' not in self.env.context and len(self) == 1 and self.state == 'draft': - # Get attachments. - # - 'attachments' is a namedtuple defined in mail.thread looking like: - # _Attachment = namedtuple('Attachment', ('fname', 'content', 'info')) - # - 'attachment_ids' is a list of ir.attachment records ids. - attachments = kwargs.get('attachments', []) - if kwargs.get('attachment_ids'): - attachments += self.env['ir.attachment'].browse(kwargs['attachment_ids']) - - for attachment in attachments: + for attachment in res.attachment_ids: self._create_invoice_from_attachment(attachment) return res