[REF] Stock/product.py

bzr revid: jvo@tinyerp.com-20100525120336-wx7chzp2x50k5j34
This commit is contained in:
Jay (Open ERP)
2010-05-25 17:33:36 +05:30
parent 72336e04ad
commit 7a5cc7c838
2 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -292,7 +292,7 @@ class sale_order(osv.osv):
'partner_invoice_id': lambda self, cr, uid, context: context.get('partner_id', False) and self.pool.get('res.partner').address_get(cr, uid, [context['partner_id']], ['invoice'])['invoice'],
'partner_order_id': lambda self, cr, uid, context: context.get('partner_id', False) and self.pool.get('res.partner').address_get(cr, uid, [context['partner_id']], ['contact'])['contact'],
'partner_shipping_id': lambda self, cr, uid, context: context.get('partner_id', False) and self.pool.get('res.partner').address_get(cr, uid, [context['partner_id']], ['delivery'])['delivery'],
'pricelist_id': lambda self, cr, uid, context: context.get('partner_id', False) and self.pool.get('res.partner').browse(cr, uid, context['partner_id']).property_product_pricelist.id,
# 'pricelist_id': lambda self, cr, uid, context: context.get('partner_id', False) and self.pool.get('res.partner').browse(cr, uid, context['partner_id']).property_product_pricelist.id,
}
_order = 'name desc'
+5 -5
View File
@@ -148,10 +148,10 @@ class product_product(osv.osv):
return res
def get_product_available(self,cr,uid,ids,context=None):
if not context:
if context is None:
context = {}
states=context.get('states',[])
what=context.get('what',())
states = context.get('states',[])
what = context.get('what',())
if not ids:
ids = self.search(cr, uid, [])
res = {}.fromkeys(ids, 0.0)
@@ -184,9 +184,9 @@ class product_product(osv.osv):
# build the list of ids of children of the location given by id
if context.get('compute_child',True):
child_location_ids = self.pool.get('stock.location').search(cr, uid, [('location_id', 'child_of', location_ids)])
location_ids= len(child_location_ids) and child_location_ids or location_ids
location_ids = child_location_ids or location_ids
else:
location_ids= location_ids
location_ids = location_ids
uoms_o = {}
product2uom = {}