[FIX] product.uom: safer handling of factor/factor_inv in UI
Add readonly attribute to avoid sending both factor and factor_inv value to the backend when saving. This was possible if the user switched between uom_type to fill the two fields.
This commit is contained in:
parent
fa2f7b86bf
commit
3a0af6af7b
|
@ -421,8 +421,14 @@
|
||||||
<field name="uom_type" on_change="onchange_type(uom_type)"/>
|
<field name="uom_type" on_change="onchange_type(uom_type)"/>
|
||||||
<label for="factor"/>
|
<label for="factor"/>
|
||||||
<div>
|
<div>
|
||||||
<field name="factor" digits="[42,5]" attrs="{'invisible':[('uom_type','!=','smaller')]}"/>
|
<field name="factor"
|
||||||
<field name="factor_inv" digits="[42,5]" attrs="{'invisible':[('uom_type','!=','bigger')]}"/>
|
digits="[42,5]"
|
||||||
|
attrs="{'invisible':[('uom_type','!=','smaller')],
|
||||||
|
'readonly':[('uom_type','!=','smaller')]}"/>
|
||||||
|
<field name="factor_inv"
|
||||||
|
digits="[42,5]"
|
||||||
|
attrs="{'invisible':[('uom_type','!=','bigger')],
|
||||||
|
'readonly':[('uom_type','!=','bigger')]}"/>
|
||||||
<p attrs="{'invisible':[('uom_type','!=','smaller')]}" class="oe_grey">
|
<p attrs="{'invisible':[('uom_type','!=','smaller')]}" class="oe_grey">
|
||||||
e.g: 1 * (reference unit) = ratio * (this unit)
|
e.g: 1 * (reference unit) = ratio * (this unit)
|
||||||
</p>
|
</p>
|
||||||
|
|
Loading…
Reference in New Issue