Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Inventory

Entity: stock.picking

Compute Method: _compute_shipping_weight

Inputs Method Outputs
for picking in self:
            # if shipping weight is not assigned => default to calculated product weight
            shipping_weight = picking.weight_bulk
            relevant_packages = picking.move_line_ids.result_package_id.outermost_package_id
            packages_weight = relevant_packages.sudo()._get_weight(picking.id)
            for package in relevant_packages:
                if package.shipping_weight:
                    shipping_weight += package.shipping_weight
                else:
                    shipping_weight += packages_weight.get(package, 0)
            picking.shipping_weight = shipping_weight

Back to entity