Skip to content
Snippets Groups Projects
Commit 13704c7b authored by Ricardo Gomes Rodrigues (rigr)'s avatar Ricardo Gomes Rodrigues (rigr)
Browse files

[FIX] account: preview not displayed when uploading a pdf


Steps to reproduce:
1. Customer invoices
2. Upload button
3. Choose a PDF
4. The created invoice does not display the pdf preview

Related commits: a6447663 and 0ab0a92360ba1abe85d0405957d4ed6c6296f8c1

closes odoo/odoo#109108

X-original-commit: 801a80aa
Signed-off-by: default avatarLaurent Smet <las@odoo.com>
Signed-off-by: default avatarRicardo Gomes Rodrigues (rigr) <rigr@odoo.com>
parent cf3283c9
No related branches found
No related tags found
No related merge requests found
......@@ -741,6 +741,7 @@ class AccountJournal(models.Model):
if not invoice:
invoice = self.env['account.move'].create({})
invoice.with_context(no_new_invoice=True).message_post(attachment_ids=[attachment.id])
attachment.write({'res_model': 'account.move', 'res_id': invoice.id})
invoices += invoice
return invoices
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment