Merge lp:~therp-nl/openobject-addons/trunk-wms-mrp-performance into lp:~openerp-dev/openobject-addons/trunk-wms

Proposed by Holger Brunn (Therp)
Status: Needs review
Proposed branch: lp:~therp-nl/openobject-addons/trunk-wms-mrp-performance
Merge into: lp:~openerp-dev/openobject-addons/trunk-wms
Prerequisite: lp:~therp-nl/openobject-addons/trunk-wms-lp1316590
Diff against target: 37 lines (+16/-5)
1 file modified
mrp/mrp.py (+16/-5)
To merge this branch: bzr merge lp:~therp-nl/openobject-addons/trunk-wms-mrp-performance
Reviewer Review Type Date Requested Status
OpenERP R&D Team Pending
Review via email: mp+219147@code.launchpad.net
To post a comment you must log in.

Unmerged revisions

9713. By Holger Brunn (Therp)

[FIX] safeguard against empty context

9712. By Holger Brunn (Therp)

[IMP] performance tweaks

9711. By Holger Brunn (Therp)

[IMP] defer processing store function fields when bulk creating stock
moves

9710. By Quentin (OpenERP) <email address hidden>

[FIX] warehouse config for resuply warehouses

9709. By Quentin (OpenERP) <email address hidden>

[FIX] fixes

9708. By Quentin (OpenERP) <email address hidden>

[REV] revert of a partially wrong commit introduced in a previous merge with trunk and detected during the code review

9707. By Quentin (OpenERP) <email address hidden>

[REF] product: get_price_history refactored and moved in product.template object

9706. By Josse Colpaert (OpenERP)

[IMP] Correct js assets for barcode scanner

9705. By Josse Colpaert (OpenERP)

[IMP] Picking type instead of warehouse in PoS

9704. By Josse Colpaert (OpenERP)

[DEL] Delete boards

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'mrp/mrp.py'
2--- mrp/mrp.py 2014-05-08 11:59:17 +0000
3+++ mrp/mrp.py 2014-05-12 07:44:38 +0000
4@@ -1044,17 +1044,28 @@
5 """
6 uncompute_ids = filter(lambda x: x, [not x.product_lines and x.id or False for x in self.browse(cr, uid, ids, context=context)])
7 self.action_compute(cr, uid, uncompute_ids, context=context)
8+ stock_moves = []
9 for production in self.browse(cr, uid, ids, context=context):
10 self._make_production_produce_line(cr, uid, production, context=context)
11
12- stock_moves = []
13 for line in production.product_lines:
14- stock_move_id = self._make_production_consume_line(cr, uid, line, context=context)
15+ stock_move_id = self._make_production_consume_line(
16+ cr, uid, line, context=dict(context or {},
17+ no_store_function=True))
18 if stock_move_id:
19 stock_moves.append(stock_move_id)
20- if stock_moves:
21- self.pool.get('stock.move').action_confirm(cr, uid, stock_moves, context=context)
22- production.write({'state': 'confirmed'}, context=context)
23+
24+ stock_move = self.pool['stock.move']
25+ if stock_moves:
26+ stock_move.action_confirm(cr, uid, stock_moves, context=context)
27+
28+ for order, model_name, _ids, fields in stock_move._store_get_values(
29+ cr, uid, stock_moves, list(set(stock_move._columns.keys() +
30+ stock_move._inherits.values())),
31+ context):
32+ self.pool[model_name]._store_set_values(cr, uid, _ids, fields,
33+ context)
34+ self.write(cr, uid, ids, {'state': 'confirmed'}, context=context)
35 return 0
36
37 def action_assign(self, cr, uid, ids, context=None):