Skip to content
Snippets Groups Projects
Commit 801a80aa 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#109092

Signed-off-by: default avatarLaurent Smet <las@odoo.com>
parent 1bc3d37e
No related branches found
No related tags found
No related merge requests found
......@@ -641,6 +641,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