Skip to content
Snippets Groups Projects
Commit 08dabc19 authored by Guillaume (guva)'s avatar Guillaume (guva)
Browse files

[FIX] l10n_in_purchase: right journal id in bills


The journal id from a purchase order was not
taken into account when creating the bill

Override _prepare_invoice method and add
the journal_id to the vals.

opw-3080805

closes odoo/odoo#107790

X-original-commit: ce2b0f8d
Signed-off-by: default avatarBrice Bartoletti (bib) <bib@odoo.com>
Signed-off-by: default avatarGuillaume Vanleynseele (guva) <guva@odoo.com>
parent fee44f5a
Branches
Tags
No related merge requests found
......@@ -41,3 +41,9 @@ class PurchaseOrder(models.Model):
if not l10n_in_gst_treatment:
l10n_in_gst_treatment = order.partner_id.vat and 'regular' or 'consumer'
order.l10n_in_gst_treatment = l10n_in_gst_treatment
def _prepare_invoice(self):
invoice_vals = super()._prepare_invoice()
if self.l10n_in_journal_id:
invoice_vals.update({'journal_id': self.l10n_in_journal_id.id})
return invoice_vals
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment