diff --git a/addons/product/models/product_uom.py b/addons/product/models/product_uom.py index 6a3a0414778..9c3baa4d6db 100644 --- a/addons/product/models/product_uom.py +++ b/addons/product/models/product_uom.py @@ -61,6 +61,13 @@ class ProductUoM(models.Model): values['factor'] = factor_inv and (1.0 / factor_inv) or 0.0 return super(ProductUoM, self).create(values) + @api.multi + def write(self, values): + if 'factor_inv' in values: + factor_inv = values.pop('factor_inv') + values['factor'] = factor_inv and (1.0 / factor_inv) or 0.0 + return super(ProductUoM, self).write(values) + @api.model def name_create(self, name): """ The UoM category and factor are required, so we'll have to add temporary values