summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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