Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
With delivery module, two new fields were added for weight to stock.picking: weight and weight_bulk.
weight = fields.Float(compute='_cal_weight', digits=dp.get_precision('Stock Weight'), store=True)
weight_bulk = fields.Float('Bulk Weight', compute='_compute_bulk_weight')
Here is how both are calculated:
for picking in self:
picking.weight = sum(move.weight for move in picking.move_lines if move.state != 'cancel')
weight = 0.0
uom_obj = self.env['product.uom']
for packop in self.pack_operation_ids:
if packop.product_id and not packop.result_package_id:
weight += uom_obj._compute_qty_obj(packop.product_uom_id , packop.product_qty, packop.product_id.uom_id) * packop.product_id.weight
self.weight_bulk = weight
First there is issues with _cal_weight witch doesn't take care of the UoM at all. And after looking in the code from different carriers in the enterprise modules, I realized delivery_ups and delivery_dhl use weight_bulk but the other simply use the weight field.
Anyone making since of this?
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 1/28/16, 5:13 PM|
|Seen: 860 times|
|Last updated: 6/1/17, 10:12 AM|