[FIX] delivery: field name 'length' is reserved in JS

length is a reserved attribute in JavaScript, and may cause problems
when returning the object to the JS framework.
This commit is to rename the field.

PR
Task 2152050

closes odoo/odoo#43222

Related: odoo/enterprise#7686
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
This commit is contained in:
yhu-odoo
2020-01-09 12:53:41 +00:00
parent d585882e2f
commit 2de4417ccd
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -9,7 +9,7 @@ class ProductPackaging(models.Model):
height = fields.Integer('Height')
width = fields.Integer('Width')
length = fields.Integer('Length')
packaging_length = fields.Integer('Length')
max_weight = fields.Float('Max Weight', help='Maximum weight shippable in this packaging')
shipper_package_code = fields.Char('Package Code')
package_carrier_type = fields.Selection([('none', 'No carrier integration')], string='Carrier', default='none')
@@ -17,7 +17,7 @@ class ProductPackaging(models.Model):
_sql_constraints = [
('positive_height', 'CHECK(height>=0)', 'Height must be positive'),
('positive_width', 'CHECK(width>=0)', 'Width must be positive'),
('positive_length', 'CHECK(length>=0)', 'Length must be positive'),
('positive_length', 'CHECK(packaging_length>=0)', 'Length must be positive'),
('positive_max_weight', 'CHECK(max_weight>=0.0)', 'Max Weight must be positive'),
]
@@ -16,7 +16,7 @@
<field name="package_carrier_type"/>
<field name="height"/>
<field name="width"/>
<field name="length"/>
<field name="packaging_length"/>
<field name="max_weight"/>
<field name="barcode"/>
<field name="shipper_package_code"/>
@@ -37,7 +37,7 @@
<field name="name"/>
<field name="height"/>
<field name="width"/>
<field name="length"/>
<field name="packaging_length"/>
<field name="max_weight"/>
<field name="shipper_package_code"/>
<field name="barcode" invisible="1"/>