Skip to content
Permalink
Browse files

fixup internation uom

  • Loading branch information...
jem-odoo committed Apr 19, 2019
1 parent ab2b9bc commit d790244a500d1465569885055af2dbd3ad9f06d8
Showing with 3 additions and 2 deletions.
  1. +3 −2 addons/uom/models/uom_uom.py
@@ -63,12 +63,13 @@ class UoM(models.Model):
('tonne', 'Tonne'), ('kilogram', 'Kilogram'), ('gram', 'Gram'), # mass
('day', 'Day'), ('hour', 'Hour'), ('minute', 'Minute'), ('second', 'Second'), # time
('cubic_meter', 'Cubic Metre'), ('cubic_decimeter', 'Cubic Decimeter'), ('cubic_centimeter', 'Cubic Centimetre') # volume
], string="Unit in the International System", readonly=True, help="Corresponding unit of measure recognized by the International System of Units (Derived included).")
], string="Unit in the International System", readonly=True, copy=False, help="Corresponding unit of measure recognized by the International System of Units (Derived included).")

_sql_constraints = [
('factor_gt_zero', 'CHECK (factor!=0)', 'The conversion ratio for a unit of measure cannot be 0!'),
('rounding_gt_zero', 'CHECK (rounding>0)', 'The rounding precision must be strictly positive.'),
('factor_reference_is_one', "CHECK((uom_type = 'reference' AND factor = 1.0) OR (uom_type != 'reference'))", "The reference unit must have a conversion factor equal to 1.")
('factor_reference_is_one', "CHECK((uom_type = 'reference' AND factor = 1.0) OR (uom_type != 'reference'))", "The reference unit must have a conversion factor equal to 1."),
('uniq_international_unit_per_categ', 'UNIQUE(category_id,international_unit)', 'Can not have 2 times the same international unit in the same category.'),
]

@api.one

0 comments on commit d790244

Please sign in to comment.
You can’t perform that action at this time.