Skip to content
Snippets Groups Projects
Commit b9f20695 authored by Denis Ledoux's avatar Denis Ledoux
Browse files

[FIX] product: price list report without purchase access rights

Pass the fields parameter in the call to the `read` method,
so it fetches only the needed fields:
 - Better performances,
 - Avoid possible access rights issues.

In this case, it wasn't possible for a user
having no access rights to the purchase module
to print this report.

opw-670449
parent 8e2a3099
No related branches found
No related tags found
No related merge requests found
......@@ -90,7 +90,7 @@ class product_pricelist(report_sxw.rml_parse):
if price_dict[pricelist_id]:
price = self.formatLang(price_dict[pricelist_id], digits=sale_price_digits, currency_obj=pricelist.currency_id)
else:
res = self.pool.get('product.product').read(self.cr, self.uid, [product_id])
res = self.pool.get('product.product').read(self.cr, self.uid, [product_id], ['list_price'])
price = self.formatLang(res[0]['list_price'], digits=sale_price_digits, currency_obj=pricelist.currency_id)
return price
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment