From 07cb8499935e68663ca73c004c134f07bc598826 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 reserve are unsynchronized after button "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 de69ef449911..bcb304cda49a 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.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 + 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.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(