def get_price_by_pricelist(self, cr, uid, kwargs):
result = {}
all_pricelists_ids = self.pool.get('product.pricelist').search(
cr, SUPERUSER_ID, [('currency_id', '=', kwargs['currency_id'])])
for pricelist_obj in self.pool.get('product.pricelist').browse(cr, SUPERUSER_ID, all_pricelists_ids):
currency_position = pricelist_obj.currency_id.position
currency_symbol = pricelist_obj.currency_id.symbol
values = {}
for product_obj in self.pool.get('product.product').browse(cr, SUPERUSER_ID, kwargs['product_ids'], context={'pricelist': pricelist_obj.id}):
if currency_position == 'after':
price = str(product_obj.price) + " " + currency_symbol
else:
price = currency_symbol + " " + str(product_obj.price)
if product_obj.to_weight:
price = price + '/Kg'
values[product_obj.id] = [price, product_obj.price]
result[pricelist_obj.id] = values
return result