[FIX] When rereserving quants, make sure that in action assign he can also take into account the auto_force_assign of the picking type

bzr revid: jco@openerp.com-20140218132843-kur9gg8bak1rxk1n
This commit is contained in:
Josse Colpaert
2014-02-18 14:28:43 +01:00
parent ec11ed6413
commit 16cccdc4be
+3 -1
View File
@@ -1899,8 +1899,10 @@ class stock_move(osv.osv):
qty = move.product_qty - qty_already_assigned
quants = quant_obj.quants_get_prefered_domain(cr, uid, move.location_id, move.product_id, qty, domain=main_domain[move.id], prefered_domain=prefered_domain[move.id], fallback_domain=fallback_domain[move.id], restrict_lot_id=move.restrict_lot_id.id, restrict_partner_id=move.restrict_partner_id.id, context=context)
quant_obj.quants_reserve(cr, uid, quants, move, context=context)
if move.state != 'assigned' and move.picking_id and move.picking_type_id.auto_force_assign:
to_assign_moves.append(move.id)
#force assignation of consumable products
#force assignation of consumable products and picking type auto_force_assign
if to_assign_moves:
self.force_assign(cr, uid, to_assign_moves, context=context)
#check if a putaway rule is likely to be processed and store result on the move