[FIX] website_sale_digital: access rights error in preview order page

In preview order page, we are looking for product attachments, but if we are
using public user, we get an access rights error leading to a 403 page.

opw-2172563

X-original-commit: d07800eadf49e75c249f9a28aca2412b6b106793
This commit is contained in:
alt-odoo
2020-01-16 16:15:07 +00:00
committed by Jorge Pinna Puissant
parent dd9f893d67
commit 0bea630c98
@@ -43,10 +43,10 @@ class WebsiteSaleDigital(CustomerPortal):
# since there is nothing to pay, so we shouldn't wait for an invoice
products = order.order_line.mapped('product_id')
Attachment = request.env['ir.attachment'].sudo()
purchased_products_attachments = {}
for product in products:
# Search for product attachments
Attachment = request.env['ir.attachment']
product_id = product.id
template = product.product_tmpl_id
att = Attachment.sudo().search_read(