Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][FIX] stock_barcodes: Quant and stock move line reserve are unsynchronized… #658

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
self.state = "done_forced"
self.line_ids.barcode_scan_state = "done_forced"
for sml in self.line_ids:
if sml.reserved_uom_qty != sml.qty_done and sml.move_id.state != "waiting":
if (
float_compare(
sml.reserved_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.reserved_uom_qty = sml.qty_done
if self.is_extra_line or not self.is_stock_move_line_origin:
barcode_backorder_action = self.env.context.get(
Expand Down
Loading