odoo/odoo#204620
Created by fw-bot
Merged
at bd3b0bf3cfdb7d801b10a5bbc076c6b3cf9b85b9
Statuses:
- legal/cla: Contributor License Agreement check
- ci/runbot: Odoo Test Suite
- ci/upgrade_enterprise: Test upgrades for enterprise master
- ci/template: Contact runbot team on discord for help.
- ci/style: Optional style check. Ignore it only if strictly necessary.
- ci/security: Required security check. Can only be ignored by security team.
- label
- odoo-dev:saas-18.1-18.0-opw-4658702-ignore_delivery_lines_for_discounts-sile-424125-fw
- head
- 5ca37a019315c6af58bf63b5e3f5b62d18bb6cb6
- merged
- 7 months ago by Bugfix, Levi Siuzdak
| odoo/odoo | |
|---|---|
| 18.0 | #202519 |
| saas-18.1 | #204620 |
| saas-18.2 | #204705 |
| saas-18.3 | |
| saas-18.4 | |
| 19.0 | |
| master | #204711 |
[FW][FIX] {website_,}sale_loyalty{,_delivery}: don't discount shipping
Versions
- 18.0+
Steps
- Have a promo code that applies a 50% discount;
- have a fixed price delivery method;
- apply code on an order with said delivery method.
Issue
The 50% discount is applied to the shipping costs.
Cause
When calculating the discountable amount in _discountable_amount, it uses the _get_no_effect_on_threshold_lines method to filter out sale order lines that shouldn't impact the amount discounted. This value gets stored in the lines recordset.
Commit d0e7be7832672 overlooked the existence of this variable when modifying the _discountable_amount method, and instead used self.order_line, using all lines to calculate the discountable amount.
Solution
Use the filtered recordset to calculate the discountable amount.
Forward-Port-Of: #202519