Merge lp:~jfb-tempo-consulting/unifield-server/us-3373-2 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 4513
Proposed branch: lp:~jfb-tempo-consulting/unifield-server/us-3373-2
Merge into: lp:unifield-server
Diff against target: 32 lines (+13/-2)
1 file modified
bin/addons/stock_override/stock.py (+13/-2)
To merge this branch: bzr merge lp:~jfb-tempo-consulting/unifield-server/us-3373-2
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+331319@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/addons/stock_override/stock.py'
2--- bin/addons/stock_override/stock.py 2017-06-12 15:48:51 +0000
3+++ bin/addons/stock_override/stock.py 2017-09-26 07:32:08 +0000
4@@ -2143,6 +2143,7 @@
5 'prodlot_id', 'asset_id', 'composition_list_id', 'line_number']
6 stock_picking_obj = self.pool.get('stock.picking')
7
8+ qty_data = {}
9 for move_data in self.read(cr, uid, ids, fields_to_read, context=context):
10 search_domain = [('state', '=', 'confirmed'), ('id', '!=', move_data['id'])]
11 picking_id = move_data['picking_id'] and move_data['picking_id'][0] or False
12@@ -2166,8 +2167,18 @@
13 if move_ids:
14 move = self.read(cr, uid, move_ids[0], ['product_qty', 'product_uos_qty'], context=context)
15 res.append(move['id'])
16- self.write(cr, uid, [move['id']], {'product_qty': move['product_qty'] + move_data['product_qty'],
17- 'product_uos_qty': move['product_uos_qty'] + move_data['product_uos_qty']}, context=context)
18+ if move_data['id'] not in qty_data:
19+ qty_data[move['id']] = {
20+ 'product_qty': move['product_qty'] + move_data['product_qty'],
21+ 'product_uos_qty': move['product_uos_qty'] + move_data['product_uos_qty'],
22+ }
23+ else:
24+ qty_data[move['id']] = {
25+ 'product_qty': move['product_qty'] + qty_data[move_data['id']]['product_qty'],
26+ 'product_uos_qty': move['product_uos_qty'] + qty_data[move_data['id']]['product_uos_qty'],
27+ }
28+
29+ self.write(cr, uid, [move['id']], qty_data[move['id']].copy(), context=context)
30
31 # Update all link objects
32 proc_ids = self.pool.get('procurement.order').search(cr, uid,

Subscribers

People subscribed via source and target branches