Files
odoo_source/addons/delivery/models/product_packaging.py
T
Martin Geubelle 2ff3749064 [ADD] delivery: package editable after put in pack
* It is sometime useful to be able to set the package type and the package weight during the delivery
* These fields can be edited during the 'put in pack' operation or after, with a button in the view
* As the weight is computed, a new field 'shipping_weight' has been added
* These fields (package type and weight) will be used in the delivery carrier for the shipping
* Packaging types are now handled in a centralized way for all shippers
2016-02-01 16:04:02 +01:00

22 lines
935 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp 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'),
]