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

Proposed by Dukai Gábor
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 Pending
Review via email: mp+74206@code.launchpad.net
To post a comment you must log in.

Unmerged revisions

242. By Dukai Gábor

[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
=== modified file 'wms/object/move.py'
--- wms/object/move.py 2011-08-25 07:59:37 +0000
+++ wms/object/move.py 2011-09-06 12:25:36 +0000
@@ -169,19 +169,39 @@
169 #in the same order. This is e.g. the case when using the button 'split in two' of169 #in the same order. This is e.g. the case when using the button 'split in two' of
170 #the stock outgoing form170 #the stock outgoing form
171 r = res.pop(0)171 r = res.pop(0)
172 self.write(cr, uid, move.id, {'location_id': r[1], 'product_qty': r[0], 'state': 'assigned'})172 values = {
173 'location_id': r[1],
174 'product_qty': r[0],
175 'state': 'assigned'
176 }
177 values.update(self.onchange_quantity(cr, uid, [move.id],
178 move.product_id.id, r[0], move.product_uom.id,
179 move.product_uos.id)['value'])
180 self.write(cr, uid, move.id, values)
173 done.append(move.id)181 done.append(move.id)
174 pickings[move.picking_id.id] = 1182 pickings[move.picking_id.id] = 1
175 total_qty -= r[0]183 total_qty -= r[0]
176184
177 while res:185 while res:
178 r = res.pop(0)186 r = res.pop(0)
179 move_id = self.copy(cr, uid, move.id, {'product_qty': r[0], 'location_id': r[1]})187 values = {'product_qty': r[0], 'location_id': r[1]}
188 values.update(self.onchange_quantity(cr, uid,
189 [move.id], move.product_id.id, r[0],
190 move.product_uom.id, move.product_uos.id)['value'])
191 move_id = self.copy(cr, uid, move.id, values)
180 done.append(move_id)192 done.append(move_id)
181 total_qty -= r[0]193 total_qty -= r[0]
182194
183 if total_qty > 0:195 if total_qty > 0:
184 move_id = self.copy(cr, uid, move.id, {'product_qty': total_qty, 'location_id': original_location_id, 'state': 'confirmed'}, context=context)196 values = {
197 'product_qty': total_qty,
198 'location_id': original_location_id,
199 'state': 'confirmed'
200 }
201 values.update(self.onchange_quantity(cr, uid,
202 [move.id], move.product_id.id, total_qty,
203 move.product_uom.id, move.product_uos.id)['value'])
204 move_id = self.copy(cr, uid, move.id, values, context=context)
185205
186 if done:206 if done:
187 count += len(done)207 count += len(done)

Subscribers

People subscribed via source and target branches