From 22be775cdcf0bc44d4fcb48628008fc49a77b52e Mon Sep 17 00:00:00 2001 From: William Henrotin Date: Thu, 6 Aug 2020 08:43:37 +0000 Subject: [PATCH] [FIX] mrp: bypass flexible consumption check in immediate production Case: - create a MO for 3 units - produce only one but with more than a third of the components - the flexible consumption wizard is triggered, accept and make the backorder. - Mark as done the backorder, the immediate production wizard is triggered, accept it. -> the flexible wizard is triggered again as the components quantity do not respect the BoM. In this specific case, we want to consume all the remaining component so we would like to avoid the flexible warning. Task : 2278147 --- addons/mrp/models/mrp_production.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mrp/models/mrp_production.py b/addons/mrp/models/mrp_production.py index 4cf50b555b7..3c10c7a1ff8 100644 --- a/addons/mrp/models/mrp_production.py +++ b/addons/mrp/models/mrp_production.py @@ -1205,7 +1205,7 @@ class MrpProduction(models.Model): :rtype: list """ issues = [] - if self.env.context.get('skip_consumption', False): + if self.env.context.get('skip_consumption', False) or self.env.context.get('skip_immediate', False): return issues for order in self: if order.consumption == 'flexible' or not order.bom_id or not order.bom_id.bom_line_ids: