[IMP] stock: stock_package_type uom values from int to float
I do not see a good reason why height, width, length are integers.
It has been introduced in 2015 here: 2ff3749064 https://github.com/odoo/odoo/pull/9994
Having float is better : it's allow more expressiveness and is less prone to errors for our users.
closes odoo/odoo#85268
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
This commit is contained in:
@@ -16,9 +16,9 @@ class PackageType(models.Model):
|
||||
|
||||
name = fields.Char('Package Type', required=True)
|
||||
sequence = fields.Integer('Sequence', default=1, help="The first in the sequence is the default one.")
|
||||
height = fields.Integer('Height', help="Packaging Height")
|
||||
width = fields.Integer('Width', help="Packaging Width")
|
||||
packaging_length = fields.Integer('Length', help="Packaging Length")
|
||||
height = fields.Float('Height', help="Packaging Height")
|
||||
width = fields.Float('Width', help="Packaging Width")
|
||||
packaging_length = fields.Float('Length', help="Packaging Length")
|
||||
base_weight = fields.Float(string='Weight', help='Weight of the package type')
|
||||
max_weight = fields.Float('Max Weight', help='Maximum weight shippable in this packaging')
|
||||
barcode = fields.Char('Barcode', copy=False)
|
||||
@@ -29,9 +29,9 @@ class PackageType(models.Model):
|
||||
|
||||
_sql_constraints = [
|
||||
('barcode_uniq', 'unique(barcode)', "A barcode can only be assigned to one package type !"),
|
||||
('positive_height', 'CHECK(height>=0)', 'Height must be positive'),
|
||||
('positive_width', 'CHECK(width>=0)', 'Width must be positive'),
|
||||
('positive_length', 'CHECK(packaging_length>=0)', 'Length must be positive'),
|
||||
('positive_height', 'CHECK(height>=0.0)', 'Height must be positive'),
|
||||
('positive_width', 'CHECK(width>=0.0)', 'Width must be positive'),
|
||||
('positive_length', 'CHECK(packaging_length>=0.0)', 'Length must be positive'),
|
||||
('positive_max_weight', 'CHECK(max_weight>=0.0)', 'Max Weight must be positive'),
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user