Skip to content

Commit

Permalink
[FIX]: Updated PR with correct weight
Browse files Browse the repository at this point in the history
  • Loading branch information
victorvermot committed Jul 12, 2023
1 parent 0ae6102 commit ab1bdf5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions product_total_weight_from_packaging/models/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def get_total_weight_from_packaging(self, qty):
self.ensure_one()
qty_by_packaging_with_weight = self.with_context(
**{
"_packaging_filter": lambda p: p.max_weight,
"_packaging_filter": lambda p: p.weight,
"_packaging_values_handler": self._prepare_qty_by_packaging_values_with_weight, # noqa
}
).product_qty_by_packaging(qty)
Expand All @@ -33,5 +33,5 @@ def _prepare_qty_by_packaging_values_with_weight(
res["weight"] = self.weight
else:
packaging = self.env["product.packaging"].browse(packaging_tuple.id)
res["weight"] = packaging.max_weight
res["weight"] = packaging.weight
return res

0 comments on commit ab1bdf5

Please sign in to comment.