[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: a644766 and 0ab0a92
closes odoo/odoo#109166
X-original-commit: 7cf3f11d5072c2655802e38757b63293a9cf9d48
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Ricardo Gomes Rodrigues (rigr) <rigr@odoo.com>
This commit is contained in:
@@ -717,6 +717,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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user