diff --git a/addons/uom/data/uom_data.xml b/addons/uom/data/uom_data.xml index 0e79ad9cce7..22108411e6e 100644 --- a/addons/uom/data/uom_data.xml +++ b/addons/uom/data/uom_data.xml @@ -16,6 +16,10 @@ Working Time working_time + + Time + time + Length / Distance length @@ -53,6 +57,24 @@ smaller + + Week(s) + + + bigger + + + Day(s) + + + + + Hour(s) + + + smaller + + Day(s) diff --git a/addons/uom/models/uom_uom.py b/addons/uom/models/uom_uom.py index 2fb50dd6fe6..77465058468 100644 --- a/addons/uom/models/uom_uom.py +++ b/addons/uom/models/uom_uom.py @@ -13,6 +13,7 @@ class UoMCategory(models.Model): measure_type = fields.Selection([ ('unit', 'Units'), ('weight', 'Weight'), + ('time', 'Time (Duration)'), ('working_time', 'Working Time'), ('length', 'Length'), ('volume', 'Volume'), @@ -24,7 +25,7 @@ class UoMCategory(models.Model): @api.multi def unlink(self): - if self.filtered(lambda categ: categ.measure_type == 'working_time'): + if self.filtered(lambda categ: categ.measure_type in ['working_time', 'time']): raise UserError(_("You cannot delete this UoM Category as it is used by the system.")) return super(UoMCategory, self).unlink()