Skip to content

Commit

Permalink
shopfloor_reception: fix product_uom_qty at move line create
Browse files Browse the repository at this point in the history
When creating a move line, set product_uom_qty = 0.
Only when such line is posted this value will be aligned with qty_done.
  • Loading branch information
mmequignon committed Sep 15, 2023
1 parent a14f8e6 commit be6f87b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions shopfloor_reception/services/reception.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,7 @@ def _scan_line__find_or_create_line(self, picking, move, qty_done=1):
)
)
if not line:
qty_todo_remaining = max(
0,
move.product_uom_qty
- sum(move.move_line_ids.mapped("product_uom_qty")),
)
values = move._prepare_move_line_vals(quantity=qty_todo_remaining)
values = move._prepare_move_line_vals()
line = self.env["stock.move.line"].create(values)
return self._scan_line__assign_user(picking, line, qty_done)

Expand Down Expand Up @@ -1245,6 +1240,7 @@ def process_without_pack(self, picking_id, selected_line_id, quantity):
return self._response_for_set_destination(picking, selected_line)

def _post_line(self, selected_line):
selected_line.product_uom_qty = selected_line.qty_done
if (
selected_line.picking_id.is_shopfloor_created
and self.work.menu.allow_return
Expand Down

0 comments on commit be6f87b

Please sign in to comment.