Odoo Help


stock.picking weight confusion

Mathieu Laflamme
on 1/28/16, 5:13 PM 1,253 views

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:

@api.depends('product_id', 'move_lines')
def _cal_weight(self):
for picking in self:
picking.weight = sum(move.weight for move in picking.move_lines if move.state != 'cancel')

def _compute_bulk_weight(self):
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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 1/28/16, 5:13 PM
Seen: 1253 times
Last updated: 6/1/17, 10:12 AM