diff options
| author | jem-odoo <jem@openerp.com> | 2018-03-02 10:42:07 +0100 |
|---|---|---|
| committer | jem-odoo <jem@openerp.com> | 2018-04-09 10:13:06 +0200 |
| commit | 2d32ff4bb8a31184285cb979e8c491949249d4ca (patch) | |
| tree | 5ab76608ef4f691e40e90e919c9d3cb31668e37f /addons/uom/data/uom_data.xml | |
| parent | c71ce46b0eb3509b6805421915a8652bafd3bbbc (diff) | |
[IMP] uom: measurement type on category
In order to restrict some uom field to some uom category, it is required to
add a measurement type on uom.category. Also, this will lessen the use of
master data.
Some technical justifications:
- measure_type is not required, to allow people creating their own
uom.category. Those ones will not interfere with addons business.
- measure_type is unique: we restrict to only one category containing
time, weight, ... in order to avoid mismatch category during conversion.
(2 different weight categories can not be converted).
- measure_type on uom.uom is stored: to allow search and domain on
field, we need to store it. Usually, UoM are not updated every day,
and the number of uom in a database is not that important.
To illustrate this mecanism, a domain is added on
'project_time_mode_id', in project module. This field
is use as timesheet default uom, and we obviously want to
restrict it to time category (timesheeting in liter does
not make sense ...)
Task #1820076
Diffstat (limited to 'addons/uom/data/uom_data.xml')
| -rw-r--r-- | addons/uom/data/uom_data.xml | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/addons/uom/data/uom_data.xml b/addons/uom/data/uom_data.xml index f929564b1e4..59a2c41208c 100644 --- a/addons/uom/data/uom_data.xml +++ b/addons/uom/data/uom_data.xml @@ -6,18 +6,23 @@ --> <record id="product_uom_categ_unit" model="uom.category"> <field name="name">Unit</field> + <field name="measure_type">unit</field> </record> <record id="product_uom_categ_kgm" model="uom.category"> <field name="name">Weight</field> + <field name="measure_type">weight</field> </record> <record id="uom_categ_wtime" model="uom.category"> <field name="name">Working Time</field> + <field name="measure_type">time</field> </record> <record id="uom_categ_length" model="uom.category"> <field name="name">Length / Distance</field> + <field name="measure_type">length</field> </record> <record id="product_uom_categ_vol" model="uom.category"> <field name="name">Volume</field> + <field name="measure_type">volume</field> </record> <!-- Resource: uom.uom |
