[FIX] website_sale_digital: check product tmpl sudo

For example the portal user has restricted access to product template,
this can lead to an issue that should not be in this instance that is
checking if the product template correspond to a product sold.

opw-748480
closes #17871
This commit is contained in:
Nicolas Lempereur
2017-06-28 09:36:09 +02:00
parent cf66983f37
commit 2bda46ce78
@@ -85,7 +85,7 @@ class WebsiteSaleDigital(website_account):
# Also check for attachments in the product templates
elif res_model == 'product.template':
P = request.env['product.product']
P = request.env['product.product'].sudo()
template_ids = map(lambda x: P.browse(x).product_tmpl_id.id, purchased_products)
if res_id not in template_ids:
return redirect(self.orders_page)