Add stock_supply_production-performance-improvement.diff
This commit is contained in:
parent
ae03c5c4c4
commit
f5c2975fb5
1
series
1
series
|
@ -45,3 +45,4 @@ issue6951002_20001.diff
|
|||
issue92001_42002_52002_wsgi_protocol.diff
|
||||
|
||||
check-vies-issue12101002.patch
|
||||
stock_supply_production-performance-improvement.diff
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
diff -r 4af84eb4246d product.py
|
||||
--- a/product.py Tue Feb 17 21:08:47 2015 +0100
|
||||
+++ b/product.py Wed Apr 15 17:57:32 2015 +0200
|
||||
@@ -10,8 +10,10 @@
|
||||
class Product:
|
||||
__name__ = 'product.product'
|
||||
|
||||
- def get_supply_period(self):
|
||||
- 'Return the supply period for the product'
|
||||
+ @classmethod
|
||||
+ def get_supply_periods(cls, products):
|
||||
+ 'Return the supply period for each product'
|
||||
pool = Pool()
|
||||
Configuration = pool.get('production.configuration')
|
||||
- return int(Configuration(1).supply_period or 0)
|
||||
+ supply_period = int(Configuration(1).supply_period or 0)
|
||||
+ return dict((p, supply_period) for p in products)
|
||||
diff -r 4af84eb4246d production.py
|
||||
--- a/production.py Tue Feb 17 21:08:47 2015 +0100
|
||||
+++ b/production.py Wed Apr 15 17:57:32 2015 +0200
|
||||
@@ -87,8 +87,8 @@
|
||||
product_ids, with_childs=True)
|
||||
|
||||
# order product by supply period
|
||||
- products_period = sorted((p.get_supply_period(), p)
|
||||
- for p in sub_products)
|
||||
+ products_period = sorted((sp, p) for p, sp
|
||||
+ in Product.get_supply_periods(sub_products).iteritems())
|
||||
|
||||
for warehouse in warehouses:
|
||||
quantities = dict((x, pbl.pop((warehouse.id, x), 0))
|
Loading…
Reference in New Issue