From fdf95cf0d2d630f3ffe52dab15e8acc4ee9fa95d Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Fri, 21 Feb 2020 14:23:30 +0000 Subject: [PATCH] [FIX] stock: do not include service in picking - Create a kit which contains a stockable product and a service - Create a SO with the kit, validate The service is included in the picking, while it shouldn't be. The procurements only make sense for for consumable and stockable products. Therefore, we do not run procurements for services. opw-2201923 closes odoo/odoo#46175 X-original-commit: 30387a1a6e90adf760146591809ad141ff645187 Signed-off-by: Nicolas Martinelli (nim) --- addons/stock/models/stock_rule.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/stock/models/stock_rule.py b/addons/stock/models/stock_rule.py index b4bbbb07ef1..0326644bf14 100644 --- a/addons/stock/models/stock_rule.py +++ b/addons/stock/models/stock_rule.py @@ -407,7 +407,10 @@ class ProcurementGroup(models.Model): procurement.values.setdefault('company_id', self.env.company) procurement.values.setdefault('priority', '1') procurement.values.setdefault('date_planned', fields.Datetime.now()) - if float_is_zero(procurement.product_qty, precision_rounding=procurement.product_uom.rounding): + if ( + procurement.product_id.type not in ('consu', 'product') or + float_is_zero(procurement.product_qty, precision_rounding=procurement.product_uom.rounding) + ): continue rule = self._get_rule(procurement.product_id, procurement.location_id, procurement.values) if not rule: