From 8d5c76cc95d22798e0517640714f4f4fb4080235 Mon Sep 17 00:00:00 2001 From: Nans Lefebvre Date: Fri, 8 Feb 2019 15:26:47 +0000 Subject: [PATCH] [FIX] purchase: use the vendor currency as default currency for vendor bills Create a new vendor bill. Choose a vendor with a "supplier currency" different from the company default. The currency on the vendor bill does not change to the currency of the vendor, unlike when a purchase order is created. We set the currency in the partner_id onchange. opw 1932683 closes odoo/odoo#30961 --- addons/purchase/models/account_invoice.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/purchase/models/account_invoice.py b/addons/purchase/models/account_invoice.py index e9d601ee9f7..4ac0a3a4156 100644 --- a/addons/purchase/models/account_invoice.py +++ b/addons/purchase/models/account_invoice.py @@ -146,6 +146,8 @@ class AccountInvoice(models.Model): self.journal_id = default_journal_id if self.env.context.get('default_currency_id'): self.currency_id = self.env.context['default_currency_id'] + if self.partner_id.property_purchase_currency_id: + self.currency_id = self.partner_id.property_purchase_currency_id return res @api.model