[6.1][7.0][trunk][stock] Move destination and action_done bug
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
This bug can be observed when the fix for following bug is applied:
https:/
[6.1]
When doing a partial picking, a new move is created when the quantity quantity received/sent is lesser than the expected one.
For eg: You are waiting for 10xPCE, you received 6xPCE:
A: stock.move with 10xPCE -> state ASSIGNED
after the partial picking, it gives:
A: stock.move with 4xPCE -> state ASSIGNED
B: stock.move with 6xPCE -> state DONE
But if you take a look "stock_
if move.move_
This part of code was Ok before because the move_dest_id was not copied in the newly create move.
Fix proposal:
Replace "force_assign" with "check_assign" AND doing it AFTER the move state is set to done.
see screenshot attached
description: | updated |
Changed in openobject-addons: | |
status: | New → Incomplete |
The "check_assign" behavior seems to randomly works for me so I just added a force_assign when all moves attached to a specific move via move_dest_id are 'done' or 'cancel':
for move_dest_id in self.browse(cr, uid, move_dest_ids, context=context):
force_ assignment = True moves_ids = self.search(cr, uid, [('move_dest_id', '=', move_dest_id.id)])
force_ assignment = False
parent_
for parent_move in self.browse(cr, uid, parent_moves_ids, context=context):
if parent_move.state not in ('done','cancel'):
break
if force_assignment:
self.force_ assign( cr, uid, [move_dest_id.id], context=context)
self.check_ assign( cr, uid, [move_dest_id.id], context=context)
else:
if move_dest_ id.picking_ id:
wf_service. trg_write( uid, 'stock.picking', move_dest_ id.picking_ id.id, cr) id.auto_ validate:
self.action_ done(cr, uid, [move_dest_id.id], context=context)
if move_dest_