[FIX] Change locations and problem location ids qty_available
bzr revid: jco@openerp.com-20130514081059-uwef9yftyv9c2n9z
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user