[FIX] product: bigger ratio
- Create a new unit of measure with 'Bigger than the reference Unit of Measure' - Save - Edit and change the ratio ==> the ratio is set back to its value opw-695507
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user