From b8950ab49a1176bc33a7180d327cbf32f4dbccdd Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Mon, 25 Mar 2019 13:54:19 +0000 Subject: [PATCH] [FIX] purchase: currency of supplierinfo Set the currency of the supplier info according to the currency set on the partner. opw-1951314 closes odoo/odoo#32098 Signed-off-by: Nicolas Martinelli (nim) --- addons/purchase/models/product.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/addons/purchase/models/product.py b/addons/purchase/models/product.py index 49897429a4e..2de7e229044 100644 --- a/addons/purchase/models/product.py +++ b/addons/purchase/models/product.py @@ -91,3 +91,11 @@ class ProductCategory(models.Model): 'account.account', string="Price Difference Account", company_dependent=True, help="This account will be used to value price difference between purchase price and accounting cost.") + + +class SupplierInfo(models.Model): + _inherit = "product.supplierinfo" + + @api.onchange('name') + def _onchange_partner_id(self): + self.currency_id = self.name.property_purchase_currency_id or self.env.user.company_id.currency_id