summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorAnh Thao Pham (pta) <pta@odoo.com>2020-06-12 06:28:48 +0000
committerAnh Thao Pham (pta) <pta@odoo.com>2020-06-12 10:40:58 +0000
commitd2bd958765734108065e7f5a46021ba34cadfdc6 (patch)
tree99289f48a7fa76ee969aae413d6381915c1f429a /addons
parent0fe8ba7a42eaf31ce749763052d041693d0ffc64 (diff)
[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#52912 X-original-commit: 09a339f15b7550944569ee6c251e677d7032933d Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/website_sale_digital/models/account_invoice.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/website_sale_digital/models/account_invoice.py b/addons/website_sale_digital/models/account_invoice.py
index e75b42d4a4a..bc0fc0636c9 100644
--- a/addons/website_sale_digital/models/account_invoice.py
+++ b/addons/website_sale_digital/models/account_invoice.py
@@ -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'],
)