From 4ce7af357317886cfd7f08e7b1e23c6a56d9f431 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Mon, 24 Nov 2014 10:51:23 +0100 Subject: [PATCH] [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. --- addons/product/product.py | 1 + addons/product/product_view.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/product/product.py b/addons/product/product.py index ce5b9bacddf..abdbcaf4895 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -152,6 +152,7 @@ class product_uom(osv.osv): _defaults = { 'active': 1, 'rounding': 0.01, + 'factor': 1, 'uom_type': 'reference', } diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml index a59a77c1357..f0908ddc46e 100644 --- a/addons/product/product_view.xml +++ b/addons/product/product_view.xml @@ -424,7 +424,7 @@ + 'readonly':[('uom_type','=','bigger')]}"/>