[FIX] Change locations and problem location ids qty_available
authorJosse Colpaert <jco@openerp.com>
Tue, 14 May 2013 08:10:59 +0000 (10:10 +0200)
committerJosse Colpaert <jco@openerp.com>
Tue, 14 May 2013 08:10:59 +0000 (10:10 +0200)
bzr revid: jco@openerp.com-20130514081059-uwef9yftyv9c2n9z

addons/stock/product.py
addons/stock_location/test/stock_location_pull_flow.yml

index 3260ec0..aef8bab 100644 (file)
@@ -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
index 6c4adca..76b3a4c 100644 (file)
         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