From bf12d53516f8616a028142d87f8710d9565a9cbd Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Wed, 4 Sep 2013 10:38:37 +0200 Subject: [PATCH] [FIX] Check for None when reserving quants, add to demo data of multi warehouse bzr revid: jco@openerp.com-20130904083837-g668i3g1fyt26gp1 --- addons/stock/stock.py | 3 +-- .../stock_multi_warehouse.yml | 21 ++++++++++++++++++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 93f0e651420..51993fcb21c 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -774,7 +774,7 @@ class stock_picking(osv.osv): quant_obj.quants_reserve(cr, uid, quants, move, context=context) #In the end, move quants in correct package if create: - quant_obj.write(cr, uid, [x[0].id for x in quants], {'package_id': ops.result_package_id and ops.result_package_id.id or False}, context=context) + quant_obj.write(cr, uid, [x[0].id for x in quants if x != None], {'package_id': ops.result_package_id and ops.result_package_id.id or False}, context=context) res2[move.id] -= qty res[ops.id] = {} res[ops.id][ops.product_id.id] = qty_to_do @@ -1037,7 +1037,6 @@ class stock_move(osv.osv): for quant in move.reserved_quant_ids: res[move.id] -= quant.qty return res - def _get_lot_ids(self, cr, uid, ids, field_name, args, context=None): res = dict.fromkeys(ids, False) diff --git a/addons/stock_multi_warehouse/stock_multi_warehouse.yml b/addons/stock_multi_warehouse/stock_multi_warehouse.yml index 14cbfbc9ae3..2ce7eadde73 100644 --- a/addons/stock_multi_warehouse/stock_multi_warehouse.yml +++ b/addons/stock_multi_warehouse/stock_multi_warehouse.yml @@ -53,7 +53,7 @@ name: Panama Santiago District Warehouse lot_stock_id: location_panama_santiago - - Create picking types for this warehouse + Create picking type in for this warehouse - !record {model: stock.picking.type, id: picking_type_santiago_in}: name: Reception @@ -61,6 +61,25 @@ sequence_id: stock.seq_picking_type_in warehouse_id: wh_panama_santiago default_location_dest_id: location_panama_santiago_input +- + Create picking type out for this warehouse +- + !record {model: stock.picking.type, id: picking_type_santiago_out}: + name: Deliveries + code_id: outgoing + sequence_id: stock.seq_picking_type_out + warehouse_id: wh_panama_santiago + default_location_src_id: location_panama_santiago_output +- + Create picking type internal for this warehouse +- + !record {model: stock.picking.type, id: picking_type_santiago_internal}: + name: Deliveries + code_id: internal + sequence_id: stock.seq_picking_type_internal + warehouse_id: wh_panama_santiago + default_location_src_id: location_panama_santiago_input + default_location_dest_id: location_panama_santiago_stock - Create Location structure of Warehouse Panama Main -