[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) <nim@odoo.com>
This commit is contained in:
Nicolas Martinelli
2019-03-26 08:02:29 +00:00
parent 11b1e12cde
commit b8950ab49a
+8
View File
@@ -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