Merge lp:~gdukai/wms/fix-check_assign_uos into lp:wms

Proposed by Dukai Gábor on 2011-09-06
Status: Needs review
Proposed branch: lp:~gdukai/wms/fix-check_assign_uos
Merge into: lp:wms
Diff against target: 46 lines (+23/-3)
1 file modified
wms/object/move.py (+23/-3)
To merge this branch: bzr merge lp:~gdukai/wms/fix-check_assign_uos
Reviewer Review Type Date Requested Status
OpenERP WMS Commiter 2011-09-06 Pending
Review via email: mp+74206@code.launchpad.net
To post a comment you must log in.

Unmerged revisions

242. By Dukai Gábor on 2011-09-05

[FIX] move.check_assign() didn't update uos

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'wms/object/move.py'
2--- wms/object/move.py 2011-08-25 07:59:37 +0000
3+++ wms/object/move.py 2011-09-06 12:25:36 +0000
4@@ -169,19 +169,39 @@
5 #in the same order. This is e.g. the case when using the button 'split in two' of
6 #the stock outgoing form
7 r = res.pop(0)
8- self.write(cr, uid, move.id, {'location_id': r[1], 'product_qty': r[0], 'state': 'assigned'})
9+ values = {
10+ 'location_id': r[1],
11+ 'product_qty': r[0],
12+ 'state': 'assigned'
13+ }
14+ values.update(self.onchange_quantity(cr, uid, [move.id],
15+ move.product_id.id, r[0], move.product_uom.id,
16+ move.product_uos.id)['value'])
17+ self.write(cr, uid, move.id, values)
18 done.append(move.id)
19 pickings[move.picking_id.id] = 1
20 total_qty -= r[0]
21
22 while res:
23 r = res.pop(0)
24- move_id = self.copy(cr, uid, move.id, {'product_qty': r[0], 'location_id': r[1]})
25+ values = {'product_qty': r[0], 'location_id': r[1]}
26+ values.update(self.onchange_quantity(cr, uid,
27+ [move.id], move.product_id.id, r[0],
28+ move.product_uom.id, move.product_uos.id)['value'])
29+ move_id = self.copy(cr, uid, move.id, values)
30 done.append(move_id)
31 total_qty -= r[0]
32
33 if total_qty > 0:
34- move_id = self.copy(cr, uid, move.id, {'product_qty': total_qty, 'location_id': original_location_id, 'state': 'confirmed'}, context=context)
35+ values = {
36+ 'product_qty': total_qty,
37+ 'location_id': original_location_id,
38+ 'state': 'confirmed'
39+ }
40+ values.update(self.onchange_quantity(cr, uid,
41+ [move.id], move.product_id.id, total_qty,
42+ move.product_uom.id, move.product_uos.id)['value'])
43+ move_id = self.copy(cr, uid, move.id, values, context=context)
44
45 if done:
46 count += len(done)

Subscribers

People subscribed via source and target branches