Skip to content
Snippets Groups Projects
Commit e467681c authored by Sylvain Van Hoof's avatar Sylvain Van Hoof Committed by Nicolas Martinelli
Browse files

[FIX] delivery: consistent return type

The original method `put_in_pack` returns a `stock.quant.package`.
Therefore, the override should do so.

Fixes #27636
opw-1912671

closes odoo/odoo#29229
parent e9bc13fc
No related branches found
No related tags found
No related merge requests found
......@@ -130,7 +130,7 @@ class StockPicking(models.Model):
current_package_carrier_type = self.carrier_id.delivery_type if self.carrier_id.delivery_type not in ['base_on_rule', 'fixed'] else 'none'
count_packaging = self.env['product.packaging'].search_count([('package_carrier_type', '=', current_package_carrier_type)])
if not count_packaging:
return False
return package
# By default, sum the weights of all package operations contained in this package
pack_operation_ids = self.env['stock.pack.operation'].search([('result_package_id', '=', package.id)])
package_weight = sum([x.qty_done * x.product_id.weight for x in pack_operation_ids])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment