[FIX] account: bill import wizard: link attachments to the created invoices instead of the file chooser wizard
This commit is contained in:
@@ -13,6 +13,7 @@ class ImportInvoiceImportWizard(models.TransientModel):
|
||||
def _create_invoice_from_file(self, attachment):
|
||||
invoice_form = Form(self.env['account.invoice'], view='account.invoice_supplier_form')
|
||||
invoice = invoice_form.save()
|
||||
attachment.write({'res_model': 'account.invoice', 'res_id': invoice.id})
|
||||
invoice.message_post(attachment_ids=[attachment.id])
|
||||
return invoice
|
||||
|
||||
|
||||
Reference in New Issue
Block a user