From 61db286a91ff7e514101e49f17b9b639d9ffb8a4 Mon Sep 17 00:00:00 2001 From: "Pieter Claeys (clpi)" Date: Mon, 6 Nov 2023 09:08:14 +0100 Subject: [PATCH] [FIX] mrp: MO reservation state bug for serial final product To reproduce: - Set tracking mode on Table Leg to no tracking and add 100 to inventory - Create MO for table with quantity more than one and confirm - Click the "+" button to generate a serial Current behavior: The reservation state of the MO goes to "available" in orange, indicating its components are not all assigned. Expected behavior: The reservation state of the MO stays "available" in green, indicating the MO has all of its components assigned and is ready to produce. closes odoo/odoo#141130 Signed-off-by: Arnold Moyaux (arm) --- addons/mrp/models/stock_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mrp/models/stock_move.py b/addons/mrp/models/stock_move.py index cffa9188282..036d26dce33 100644 --- a/addons/mrp/models/stock_move.py +++ b/addons/mrp/models/stock_move.py @@ -578,6 +578,6 @@ class StockMove(models.Model): res = super()._get_relevant_state_among_moves() if res == 'partially_available'\ and self.raw_material_production_id\ - and all(float_compare(move.quantity, move.should_consume_qty, precision_rounding=move.product_uom.rounding) == 0 for move in self): + and all(move.should_consume_qty and float_compare(move.quantity, move.should_consume_qty, precision_rounding=move.product_uom.rounding) >= 0 for move in self): res = 'assigned' return res