[FIX] When move is a return, assigned quants should have been processed by the original move
bzr revid: jco@openerp.com-20140130095328-v63lo6dg1d951z2f
This commit is contained in:
parent
e89b9b8539
commit
b62f8a6469
|
@ -1727,6 +1727,8 @@ class stock_move(osv.osv):
|
||||||
fallback_domain = prev_quant_ids and [('id', 'not in', prev_quant_ids)] or []
|
fallback_domain = prev_quant_ids and [('id', 'not in', prev_quant_ids)] or []
|
||||||
#we always keep the quants already assigned and try to find the remaining quantity on quants not assigned only
|
#we always keep the quants already assigned and try to find the remaining quantity on quants not assigned only
|
||||||
main_domain = [('reservation_id', '=', False), ('qty', '>', 0)]
|
main_domain = [('reservation_id', '=', False), ('qty', '>', 0)]
|
||||||
|
if move.origin_returned_move_id:
|
||||||
|
main_domain += [('history_ids', 'in', move.origin_returned_move_id.id)]
|
||||||
#first try to find quants based on specific domains given by linked operations
|
#first try to find quants based on specific domains given by linked operations
|
||||||
for record in move.linked_move_operation_ids:
|
for record in move.linked_move_operation_ids:
|
||||||
domain = main_domain + self.pool.get('stock.move.operation.link').get_specific_domain(cr, uid, record, context=context)
|
domain = main_domain + self.pool.get('stock.move.operation.link').get_specific_domain(cr, uid, record, context=context)
|
||||||
|
@ -1792,6 +1794,8 @@ class stock_move(osv.osv):
|
||||||
pickings.add(move.picking_id.id)
|
pickings.add(move.picking_id.id)
|
||||||
qty = move.product_qty
|
qty = move.product_qty
|
||||||
main_domain = [('qty', '>', 0)]
|
main_domain = [('qty', '>', 0)]
|
||||||
|
if move.origin_returned_move_id:
|
||||||
|
main_domain += [('history_ids', 'in', move.origin_returned_move_id.id)]
|
||||||
prefered_domain = [('reservation_id', '=', move.id)]
|
prefered_domain = [('reservation_id', '=', move.id)]
|
||||||
fallback_domain = [('reservation_id', '=', False)]
|
fallback_domain = [('reservation_id', '=', False)]
|
||||||
#first, process the move per linked operation first because it may imply some specific domains to consider
|
#first, process the move per linked operation first because it may imply some specific domains to consider
|
||||||
|
|
Loading…
Reference in New Issue