From b5055f67a4d639a28bfa1aca755f4ebbde80fd6e Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Tue, 14 May 2013 10:10:59 +0200 Subject: [PATCH] [FIX] Change locations and problem location ids qty_available bzr revid: jco@openerp.com-20130514081059-uwef9yftyv9c2n9z --- addons/stock/product.py | 6 ++++-- addons/stock_location/test/stock_location_pull_flow.yml | 8 +++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/stock/product.py b/addons/stock/product.py index 3260ec0af22..aef8bab516e 100644 --- a/addons/stock/product.py +++ b/addons/stock/product.py @@ -229,17 +229,19 @@ class product_product(osv.osv): if not wids: return False for w in warehouse_obj.browse(cr, uid, wids, context=context): - if not context.get('force_company', False) or w.lot_stock_id.company_id == context['force_company']: + if not context.get('force_company', False) or w.lot_stock_id.company_id.id == context['force_company']: location_ids.append(w.lot_stock_id.id) # build the list of ids of children of the location given by id if context.get('compute_child',True): + print location_ids + print context.get("force_company", False) if context.get('force_company', False): child_location_ids = location_obj.search(cr, uid, [('location_id', 'child_of', location_ids), ('company_id', '=', context['force_company'])]) else: child_location_ids = location_obj.search(cr, uid, [('location_id', 'child_of', location_ids)]) location_ids = child_location_ids or location_ids - + print location_ids return location_ids diff --git a/addons/stock_location/test/stock_location_pull_flow.yml b/addons/stock_location/test/stock_location_pull_flow.yml index 6c4adcaef36..76b3a4cc44f 100644 --- a/addons/stock_location/test/stock_location_pull_flow.yml +++ b/addons/stock_location/test/stock_location_pull_flow.yml @@ -141,25 +141,23 @@ location_id: stock.stock_location_shop0 location_src_id: stock.stock_location_shop1 name: E001 - partner_address_id: base.res_partner_address_2 picking_type: out procure_method: make_to_stock type_proc: move company_id: stock.res_company_1 - invoice_state: none location_id: stock.stock_location_shop1 - location_src_id: stock.stock_location_suppliers + location_src_id: stock.stock_location_intermediatelocation0 name: E002 - partner_address_id: base.res_partner_address_7 picking_type: out procure_method: make_to_stock type_proc: move company_id: stock.res_company_1 - invoice_state: none - location_id: stock.stock_location_suppliers + location_id: stock.stock_location_intermediatelocation0 location_src_id: stock.stock_location_stock name: E003 - type_proc: buy + type_proc: move company_id: base.main_company property_stock_inventory: stock.location_inventory property_stock_procurement: stock.location_procurement