From e69a9b1ea8f769b9fe34bdc037fa586b5f7102c8 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Wed, 1 Jul 2015 16:23:01 +0200 Subject: [PATCH] [FIX] stock: modify default destination location for Pick Ship in 2 steps: The Packing zone location is inactive but it is used by default as destination location (instead of Output) in the Pick operation. opw-643734 --- addons/stock/stock.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 99912ac67c5..644f55780cd 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -3326,7 +3326,10 @@ class stock_warehouse(osv.osv): output_loc = warehouse.lot_stock_id picking_type_obj.write(cr, uid, warehouse.in_type_id.id, {'default_location_dest_id': input_loc.id}, context=context) picking_type_obj.write(cr, uid, warehouse.out_type_id.id, {'default_location_src_id': output_loc.id}, context=context) - picking_type_obj.write(cr, uid, warehouse.pick_type_id.id, {'active': new_delivery_step != 'ship_only'}, context=context) + picking_type_obj.write(cr, uid, warehouse.pick_type_id.id, { + 'active': new_delivery_step != 'ship_only', + 'default_location_dest_id': output_loc.id if new_delivery_step == 'pick_ship' else warehouse.wh_pack_stock_loc_id.id, + }, context=context) picking_type_obj.write(cr, uid, warehouse.pack_type_id.id, {'active': new_delivery_step == 'pick_pack_ship'}, context=context) routes_dict = self.get_routes_dict(cr, uid, ids, warehouse, context=context) @@ -3448,7 +3451,7 @@ class stock_warehouse(osv.osv): 'code': 'internal', 'sequence_id': pick_seq_id, 'default_location_src_id': wh_stock_loc.id, - 'default_location_dest_id': wh_pack_stock_loc.id, + 'default_location_dest_id': output_loc.id if warehouse.delivery_steps == 'pick_ship' else wh_pack_stock_loc.id, 'active': warehouse.delivery_steps != 'ship_only', 'sequence': max_sequence + 2, 'color': color}, context=context)