From e40ab8a9ce1ddfe70a342a305362d770fc7867c6 Mon Sep 17 00:00:00 2001 From: Carlos Dauden Date: Mon, 25 Nov 2024 13:48:26 +0100 Subject: [PATCH] [FIX] stock_barcodes: Quant and stock move line reserved unsynchronized after no create backorder. TT51871 --- stock_barcodes/wizard/stock_barcodes_read_todo.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/stock_barcodes/wizard/stock_barcodes_read_todo.py b/stock_barcodes/wizard/stock_barcodes_read_todo.py index 8757081d3cb1..3b6a76b29fe6 100644 --- a/stock_barcodes/wizard/stock_barcodes_read_todo.py +++ b/stock_barcodes/wizard/stock_barcodes_read_todo.py @@ -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 + if sml.move_id.state == "confirmed" and sml.qty_done: + sml.move_id.state = "partially_available" + if sml.move_id.state in ["partially_available", "assigned"]: sml.product_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(