[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:
parent
529e920b2c
commit
4ce7af3573
|
@ -152,6 +152,7 @@ class product_uom(osv.osv):
|
|||
_defaults = {
|
||||
'active': 1,
|
||||
'rounding': 0.01,
|
||||
'factor': 1,
|
||||
'uom_type': 'reference',
|
||||
}
|
||||
|
||||
|
|
|
@ -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')],
|
||||
|
|
Loading…
Reference in New Issue