summaryrefslogtreecommitdiff
path: root/addons/uom/data/uom_data.xml
diff options
context:
space:
mode:
authorjem-odoo <jem@openerp.com>2018-03-05 09:31:25 +0100
committerjem-odoo <jem@openerp.com>2018-04-09 10:13:18 +0200
commite0ed50a724eb129451d98d93e7365b4b117cfd0a (patch)
tree084886c8bf2f86cf3c1c546ba3254877be5601bb /addons/uom/data/uom_data.xml
parent2d32ff4bb8a31184285cb979e8c491949249d4ca (diff)
[IMP] uom: unique reference UoM per category
Users can configure multiple references in a same category. This might cause problems during conversion and does not make sense. Since this is a "late" constraint, we define it in python to avoid conflict with existing data. We allow user to have multiple unactive reference, but force to have exactly one active. So when a new UoM category is created, user have to encode the reference unit first, and then the bigger/smaller ones. This commit also update stock tests, since they were redefining new reference UoM in the same category, and finally, this commit provides some tests for this uniqueness and custom UoM behavior. Task #1820076
Diffstat (limited to 'addons/uom/data/uom_data.xml')
-rw-r--r--addons/uom/data/uom_data.xml10
1 files changed, 5 insertions, 5 deletions
diff --git a/addons/uom/data/uom_data.xml b/addons/uom/data/uom_data.xml
index 59a2c41208c..2c5cf503797 100644
--- a/addons/uom/data/uom_data.xml
+++ b/addons/uom/data/uom_data.xml
@@ -51,17 +51,17 @@
<field name="factor" eval="1000"/>
<field name="uom_type">smaller</field>
</record>
+ <record id="product_uom_day" model="uom.uom">
+ <field name="name">Day(s)</field>
+ <field eval="uom_categ_wtime" name="category_id"/>
+ <field name="factor" eval="1.0"/>
+ </record>
<record id="product_uom_hour" model="uom.uom">
<field name="name">Hour(s)</field>
<field eval="uom_categ_wtime" name="category_id"/>
<field name="factor" eval="8.0"/>
<field name="uom_type">smaller</field>
</record>
- <record id="product_uom_day" model="uom.uom">
- <field name="name">Day(s)</field>
- <field eval="uom_categ_wtime" name="category_id"/>
- <field name="factor" eval="1.0"/>
- </record>
<record id="product_uom_ton" model="uom.uom">
<field name="category_id" ref="product_uom_categ_kgm"/>
<!-- 'tonne' is the most common spelling in english-speaking countries,