From 313654791fe378b5d02cba5acce623d4f6c46d3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 28 Feb 2018 18:27:34 +0100 Subject: [PATCH] Replace product_ids by grouping_filter issue7141 review44661002 --- production.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/production.py b/production.py index e89708299d..b20e93238f 100644 --- a/production.py +++ b/production.py @@ -90,8 +90,10 @@ class Production: product_ids = [p.id for p in sub_products] with Transaction().set_context(forecast=True, stock_date_end=today): - pbl = Product.products_by_location(warehouse_ids, - product_ids, with_childs=True) + pbl = Product.products_by_location( + warehouse_ids, + with_childs=True, + grouping_filter=(product_ids,)) # order product by supply period products_period = sorted((p.get_supply_period(), p) @@ -202,8 +204,10 @@ class Production: with Transaction().set_context(forecast=True, stock_date_start=current_date, stock_date_end=current_date): - pbl = Product.products_by_location([location_id], - product_ids, with_childs=True) + pbl = Product.products_by_location( + [location_id], + with_childs=True, + grouping_filter=(product_ids,)) for key, qty in pbl.iteritems(): _, product_id = key current_qties[product_id] += qty