- i have tried creating new pricelists, and the result is the same.
- the code for 6.0 and 7 differ slightly. check the def for _product_price. i will append following:
** notice: partner = context.get('partner', False). perhaps this line is causing the pricelis to search for partner context and obviously, since there is none it displays 0.00.
v6 -->
def _product_price(self, cr, uid, ids, name, arg, context=None):
res = {}
if context is None:
context = {}
quantity = context.get('quantity') or 1.0
pricelist = context.get('pricelist', False)
if pricelist:
for id in ids: try: price = self.pool.get('product.pricelist').price_get(cr,uid,[pricelist], id, quantity, context=context)[pricelist] except: price = 0.0 res[id] = price
for id in ids: res.setdefault(id, 0.0)
return res
v7 -->
def _product_price(self, cr, uid, ids, name, arg, context=None):
res = {}
if context is None:
context = {}
quantity = context.get('quantity') or 1.0
pricelist = context.get('pricelist', False)
partner = context.get('partner', False)
if pricelist:
for id in ids: try: price = self.pool.get('product.pricelist').price_get(cr,uid,[pricelist], id, quantity, partner=partner, context=context)[pricelist] except: price = 0.0 res[id] = price
for id in ids: res.setdefault(id, 0.0)
return res
some things i would like to add are:
- i have tried creating new pricelists, and the result is the same. get('partner' , False). perhaps this line is causing the pricelis to search for partner context and obviously, since there is none it displays 0.00.
- the code for 6.0 and 7 differ slightly. check the def for _product_price. i will append following:
** notice: partner = context.
v6 -->
def _product_ price(self, cr, uid, ids, name, arg, context=None): get('quantity' ) or 1.0 get('pricelist' , False)
try:
price = self.pool. get('product. pricelist' ).price_ get(cr, uid,[pricelist] , id, quantity, context= context) [pricelist]
except:
price = 0.0
res[id] = price
res. setdefault( id, 0.0)
res = {}
if context is None:
context = {}
quantity = context.
pricelist = context.
if pricelist:
for id in ids:
for id in ids:
return res
v7 -->
def _product_ price(self, cr, uid, ids, name, arg, context=None): get('quantity' ) or 1.0 get('pricelist' , False) get('partner' , False)
try:
price = self.pool. get('product. pricelist' ).price_ get(cr, uid,[pricelist] , id, quantity, partner=partner, context= context) [pricelist]
except:
price = 0.0
res[id] = price
res. setdefault( id, 0.0)
res = {}
if context is None:
context = {}
quantity = context.
pricelist = context.
partner = context.
if pricelist:
for id in ids:
for id in ids:
return res