[FIX] product: creation of reference uom

Set a default value for factor when creating a new uom.
Could not create a new UoM with type reference (if creates a reference uom, no need to pass a factor).

Change the readonly filter to (type = bigger) to make the field writable for reference uom.
This is needed to force the reset of the factor when switching of type (onchange_type).
As the field was readonly, kept the old value for factor.
This commit is contained in:
Martin Trigaux 2014-11-24 10:51:23 +01:00
parent 529e920b2c
commit 4ce7af3573
2 changed files with 2 additions and 1 deletions

View File

@ -152,6 +152,7 @@ class product_uom(osv.osv):
_defaults = {
'active': 1,
'rounding': 0.01,
'factor': 1,
'uom_type': 'reference',
}

View File

@ -424,7 +424,7 @@
<field name="factor"
digits="[42,5]"
attrs="{'invisible':[('uom_type','!=','smaller')],
'readonly':[('uom_type','!=','smaller')]}"/>
'readonly':[('uom_type','=','bigger')]}"/>
<field name="factor_inv"
digits="[42,5]"
attrs="{'invisible':[('uom_type','!=','bigger')],