diff options
| author | oco-odoo <oco@odoo.com> | 2019-09-09 10:54:11 +0000 |
|---|---|---|
| committer | oco-odoo <oco@odoo.com> | 2019-09-09 10:54:11 +0000 |
| commit | 5cf9d55bbce2e7e8b593e2c9cd178b6fc9d32c29 (patch) | |
| tree | 8013ab6366fbd72e8cd2bec2176328d83602c26f /addons | |
| parent | 55e1b4449210251ee744687a74c829469fe462ef (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.py | 2 |
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 |
