flectra/addons/delivery/models/product_packaging.py

23 lines
945 B
Python
Raw Normal View History

# -*- coding: utf-8 -*-
2018-01-16 11:34:37 +01:00
# Part of Odoo, Flectra. See LICENSE file for full copyright and licensing details.
2018-01-16 11:34:37 +01:00
from flectra import models, fields
class ProductPackaging(models.Model):
_inherit = 'product.packaging'
height = fields.Integer('Height')
width = fields.Integer('Width')
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')
_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_max_weight', 'CHECK(max_weight>=0.0)', 'Max Weight must be positive'),
]