Skip to content

Commit

Permalink
[FIX] shopfloor: fix create return move
Browse files Browse the repository at this point in the history
  • Loading branch information
sbejaoui committed Nov 26, 2024
1 parent c1cee02 commit 9cb0835
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions shopfloor/actions/stock.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class StockAction(Component):
def _create_return_move__get_max_qty(self, origin_move):
"""Returns the max returneable qty."""
# The max returnable qty is the sent qty minus the already returned qties
quantity = origin_move.reserved_qty
quantity = origin_move.product_uom_qty
for move in origin_move.move_dest_ids:
if (
move.origin_returned_move_id
Expand All @@ -28,7 +28,7 @@ def _create_return_move__get_max_qty(self, origin_move):
if move.state in ("partially_available", "assigned"):
quantity -= sum(move.move_line_ids.mapped("reserved_qty"))
elif move.state in ("done"):
quantity -= move.reserved_qty
quantity -= move.product_uom_qty
return float_round(
quantity, precision_rounding=origin_move.product_id.uom_id.rounding
)
Expand Down Expand Up @@ -92,7 +92,7 @@ def create_return_move(self, return_picking, origin_moves):
def _create_return_picking__get_vals(self, return_types, origin):
return_type = fields.first(return_types)
return {
"move_lines": [],
"move_ids": [],
"picking_type_id": return_type.id,
"state": "draft",
"origin": origin,
Expand Down

0 comments on commit 9cb0835

Please sign in to comment.