diff options
| author | Andrea Grazioso (agr-odoo) <agr@odoo.com> | 2020-12-10 11:53:21 +0000 |
|---|---|---|
| committer | Andrea Grazioso (agr-odoo) <agr@odoo.com> | 2020-12-14 12:33:32 +0000 |
| commit | eb5398cac2bcf671ccadf99b129e661faffa92d7 (patch) | |
| tree | 2cb7084664bc174918c3e8a2d8c424dcc84526d9 /addons/sale_coupon | |
| parent | 10c08157cb152f111bc9df783e15632c52a61b39 (diff) | |
[FIX] sale_coupon: select correct minimum amount with/without tax rule
Create a promotion program with the "Minimum Purchase Of" right field
left as blank
It won't be taken into account in SO when clicking on 'Promotions'
When the field is left as blank `rule_minimum_amount_tax_inclusion`
value is `False` and thus break the check.
opw-2392546
closes odoo/odoo#63326
X-original-commit: 814cd954944b76fb8a8cb8e4b8da8d17c0eec88c
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
Diffstat (limited to 'addons/sale_coupon')
| -rw-r--r-- | addons/sale_coupon/models/coupon_program.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/sale_coupon/models/coupon_program.py b/addons/sale_coupon/models/coupon_program.py index 8d529e1b61b..7b9c2f327d2 100644 --- a/addons/sale_coupon/models/coupon_program.py +++ b/addons/sale_coupon/models/coupon_program.py @@ -83,7 +83,7 @@ class CouponProgram(models.Model): untaxed_amount = order_amount['amount_untaxed'] - sum(line.price_subtotal for line in lines) tax_amount = order_amount['amount_tax'] - sum(line.price_tax for line in lines) program_amount = program._compute_program_amount('rule_minimum_amount', order.currency_id) - if program.rule_minimum_amount_tax_inclusion == 'tax_included' and program_amount <= (untaxed_amount + tax_amount) or program.rule_minimum_amount_tax_inclusion == 'tax_excluded' and program_amount <= untaxed_amount: + if program.rule_minimum_amount_tax_inclusion == 'tax_included' and program_amount <= (untaxed_amount + tax_amount) or program_amount <= untaxed_amount: program_ids.append(program.id) return self.browse(program_ids) |
