[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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user