summaryrefslogtreecommitdiff
path: root/tests/test_program_numbers.py
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-10-19 12:27:00 +0200
committerChristophe Simonis <chs@odoo.com>2018-10-19 12:27:00 +0200
commit9632d38f0a81c671e2633b8b17fed3513fdb6a59 (patch)
tree9df64a9114f9b635b080aebdde08052a1e185993 /tests/test_program_numbers.py
parent3fc388c696bb918baa1d54a0b5880c0494ecc9e5 (diff)
parent879aef37f3034556b310ad7b1beb396467153ca7 (diff)
[MERGE] forward port branch 11.0 up to cba39ad6754
Diffstat (limited to 'tests/test_program_numbers.py')
-rw-r--r--tests/test_program_numbers.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_program_numbers.py b/tests/test_program_numbers.py
index 01da22c1de4..8284cd1dad4 100644
--- a/tests/test_program_numbers.py
+++ b/tests/test_program_numbers.py
@@ -464,6 +464,12 @@ class TestSaleCouponProgramNumbers(TestSaleCouponCommon):
'discount_type': 'fixed_amount',
'discount_fixed_amount': 249.0,
})
+ self.tax_0pc_excl = self.env['account.tax'].create({
+ 'name': "0% Tax excl",
+ 'amount_type': 'percent',
+ 'amount': 0,
+ })
+ fixed_amount_program.discount_line_product_id.write({'taxes_id': [(4, self.tax_0pc_excl.id, False)]})
sol1 = self.env['sale.order.line'].create({
'product_id': self.computerCase.id,
'name': 'Computer Case',
@@ -477,6 +483,9 @@ class TestSaleCouponProgramNumbers(TestSaleCouponCommon):
order.recompute_coupon_lines()
self.assertEqual(order.amount_total, 176, "Fixed amount discount should be totally deduced")
self.assertEqual(len(order.order_line.ids), 2, "Number of lines should be unchanged as we just recompute the reward line")
+ sol2 = order.order_line.filtered(lambda l: l.id != sol1.id)
+ self.assertEqual(len(sol2.tax_id.ids), 1, "One tax should be present on the reward line")
+ self.assertEqual(sol2.tax_id.id, self.tax_0pc_excl.id, "The tax should be 0% Tax excl")
fixed_amount_program.write({'active': False}) # Check archived product will remove discount lines on recompute
order.recompute_coupon_lines()
self.assertEqual(len(order.order_line.ids), 1, "Archiving the program should remove the program reward line")