summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorMartin Trigaux <mat@openerp.com>2014-10-09 13:37:06 +0200
committerOlivier Dony <odo@openerp.com>2014-10-22 14:28:35 +0200
commit3a0af6af7b5a67dfb1ed196bd3e5da41c1dfa57a (patch)
tree4686b284fd100ae10486fa95f0b9628d6fd19307 /addons
parentfa2f7b86bff9cecad73ef14fdc1480c7bca2a584 (diff)
[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.
Diffstat (limited to 'addons')
-rw-r--r--addons/product/product_view.xml10
1 files changed, 8 insertions, 2 deletions
diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml
index 7b4539e7dd3..a59a77c1357 100644
--- a/addons/product/product_view.xml
+++ b/addons/product/product_view.xml
@@ -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>