From 7a5cc7c838b8d9dcb3dc15cd6f263479ee86aafe Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Tue, 25 May 2010 17:33:36 +0530 Subject: [PATCH] [REF] Stock/product.py bzr revid: jvo@tinyerp.com-20100525120336-wx7chzp2x50k5j34 --- addons/sale/sale.py | 2 +- addons/stock/product.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 272ee0ecd70..a322809135d 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -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' diff --git a/addons/stock/product.py b/addons/stock/product.py index ad189ee546a..dc300994232 100644 --- a/addons/stock/product.py +++ b/addons/stock/product.py @@ -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 = {}