Skip to content

Commit

Permalink
[FIX] stock_barcodes: Quant and stock move line reserve are unsynchro…
Browse files Browse the repository at this point in the history
…nized after button "no create backorder".

TT51871
  • Loading branch information
carlosdauden committed Nov 25, 2024
1 parent 7833107 commit 223130f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion stock_barcodes/wizard/stock_barcodes_read_todo.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,18 @@ def action_todo_next(self):
self.state = "done_forced"
self.line_ids.barcode_scan_state = "done_forced"
for sml in self.line_ids:
if sml.product_uom_qty != sml.qty_done and sml.move_id.state != "waiting":
if (
float_compare(
sml.product_uom_qty,
sml.qty_done,
precision_rounding=sml.product_uom_id.rounding,
)
== 0
):
continue

Check warning on line 80 in stock_barcodes/wizard/stock_barcodes_read_todo.py

View check run for this annotation

Codecov / codecov/patch

stock_barcodes/wizard/stock_barcodes_read_todo.py#L80

Added line #L80 was not covered by tests
if sml.move_id.state == "confirmed" and sml.qty_done:
sml.move_id.state = "partially_available"

Check warning on line 82 in stock_barcodes/wizard/stock_barcodes_read_todo.py

View check run for this annotation

Codecov / codecov/patch

stock_barcodes/wizard/stock_barcodes_read_todo.py#L82

Added line #L82 was not covered by tests
if sml.move_id.state in ["partially_available", "assigned"]:
sml.product_uom_qty = sml.qty_done

Check warning on line 84 in stock_barcodes/wizard/stock_barcodes_read_todo.py

View check run for this annotation

Codecov / codecov/patch

stock_barcodes/wizard/stock_barcodes_read_todo.py#L84

Added line #L84 was not covered by tests
if self.is_extra_line or not self.is_stock_move_line_origin:
barcode_backorder_action = self.env.context.get(

Check warning on line 86 in stock_barcodes/wizard/stock_barcodes_read_todo.py

View check run for this annotation

Codecov / codecov/patch

stock_barcodes/wizard/stock_barcodes_read_todo.py#L86

Added line #L86 was not covered by tests
Expand Down

0 comments on commit 223130f

Please sign in to comment.