[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:
Martin Trigaux 2014-10-09 13:37:06 +02:00 committed by Olivier Dony
parent fa2f7b86bf
commit 3a0af6af7b
1 changed files with 8 additions and 2 deletions

View File

@ -421,8 +421,14 @@
<field name="uom_type" on_change="onchange_type(uom_type)"/>
<label for="factor"/>
<div>
<field name="factor" digits="[42,5]" attrs="{'invisible':[('uom_type','!=','smaller')]}"/>
<field name="factor_inv" digits="[42,5]" attrs="{'invisible':[('uom_type','!=','bigger')]}"/>
<field name="factor"
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">
e.g: 1 * (reference unit) = ratio * (this unit)
</p>