Skip to content
Snippets Groups Projects
Commit 6977f85d authored by Jorge Pinna Puissant's avatar Jorge Pinna Puissant
Browse files

[FIX] website_sale_digital: limit attachment search


Before this commit, in a sales order preview, a search is performed to
search all the attachments in invoiced products or free products.

Now, the search is only performed if the product is a digital product.

opw-2172563

closes odoo/odoo#43434

X-original-commit: 2c9e7832a02d2e4e2f219e979dd8ae3cbaa77bd9
Signed-off-by: default avatarJorge Pinna Puissant (jpp) <jpp@odoo.com>
parent 0bea630c
No related branches found
No related tags found
No related merge requests found
......@@ -45,7 +45,7 @@ class WebsiteSaleDigital(CustomerPortal):
Attachment = request.env['ir.attachment'].sudo()
purchased_products_attachments = {}
for product in products:
for product in products.filtered(lambda p: p.attachment_count):
# Search for product attachments
product_id = product.id
template = product.product_tmpl_id
......
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