Skip to content
Snippets Groups Projects
Commit 09a339f1 authored by Anh Thao Pham (pta)'s avatar Anh Thao Pham (pta)
Browse files

[FIX] website_sale_digital: fix attachments download for free orders

- Install Sales (sale_management) and Digital Products (website_sale_digital)
- Go to Sales
- Create a product
- In product form, add a digital file via "Digital Files" smart button
- Create a quotation for current user
- Add created product
- Add a product with a negative price and make sure that the amount total ofthe order is 0.00
- Go to Website
- In portal, go to "My Account" and "Sales Orders" in Documents section
- Open created SO (with total=0.00)
- In the products list, there is a dropdown download button next to the created product
- Click on the download button and select an item in the list
You are just redirected to the list of SO in portal.

The button to download Digital Files appear for a product if one of these conditions is verified:
- The SO has been paid
- The product is free
- The SO is free (The amount total is 0.00)
But during the download action, a check is also performed allowing only to download Digital Files
from products verifying one of the 2 first conditions.

opw-2265402

closes odoo/odoo#52886

Signed-off-by: default avatarNicolas Martinelli (nim) <nim@odoo.com>
parent 710bb9f1
Branches
Tags
No related merge requests found
......@@ -23,7 +23,7 @@ class AccountInvoiceLine(models.Model):
# Get free products
purchases += self.env['sale.order.line'].sudo().search_read(
domain=[('price_subtotal', '=', 0.0), ('order_id.partner_id', '=', partner.id)],
domain=[('order_id.partner_id', '=', partner.id), '|', ('price_subtotal', '=', 0.0), ('order_id.amount_total', '=', 0.0)],
fields=['product_id'],
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment