[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
This commit is contained in:
@@ -2,11 +2,6 @@
|
||||
<odoo>
|
||||
<data noupdate="1">
|
||||
|
||||
<!-- This will set the unit of measure used in projects and tasks.-->
|
||||
<record id="base.main_company" model="res.company">
|
||||
<field name="project_time_mode_id" ref="uom.product_uom_hour"></field>
|
||||
</record>
|
||||
|
||||
<!-- sale_timesheet and project define the same field without depending on each, which causes the field to be deleted when the module that created it
|
||||
is deleted. To avoid this, we create xmlids manually for this field in both modules to prevent accidental deletion. To fix in saas-7 by moving the field definition-->
|
||||
<record id="duplicate_field_xmlid" model="ir.model.data">
|
||||
|
||||
Reference in New Issue
Block a user