summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authoroco-odoo <oco@odoo.com>2019-09-09 10:54:11 +0000
committeroco-odoo <oco@odoo.com>2019-09-09 10:54:11 +0000
commit5cf9d55bbce2e7e8b593e2c9cd178b6fc9d32c29 (patch)
tree8013ab6366fbd72e8cd2bec2176328d83602c26f /addons
parent55e1b4449210251ee744687a74c829469fe462ef (diff)
[FIX] account_facturx: retrieve attachments in the right way to create an invoice
Before that, we relied on the fact the call to super() assigned the attachment_ids field, which was wrong outside mail.compose.message. Hence, we fix that by directly browsing the attachment. closes odoo/odoo#36552 Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/account_facturx/models/account_move.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/account_facturx/models/account_move.py b/addons/account_facturx/models/account_move.py
index 721865d4d5d..548953beff1 100644
--- a/addons/account_facturx/models/account_move.py
+++ b/addons/account_facturx/models/account_move.py
@@ -222,7 +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':
- for attachment in res.attachment_ids:
+ for attachment in self.env['ir.attachment'].browse(kwargs.get('attachment_ids', [])):
self._create_invoice_from_attachment(attachment)
return res