diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-10-23 15:18:46 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-10-23 15:18:46 +0200 |
| commit | eb902f8b397e68c96ae61c6f4f5849c827d7de2e (patch) | |
| tree | 5b18ee49028acad791838f3eeef60e79661e820c /tests | |
| parent | edaff83894af8e9ff45569a53c0c0f3a80535b28 (diff) | |
| parent | 94ae74a87a2146694432e9d97c51ab8df1efc159 (diff) | |
[MERGE] forward port branch saas-11.4 up to 5999fd47c43
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_program_numbers.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_program_numbers.py b/tests/test_program_numbers.py index d78e09940f5..656ddcaad6f 100644 --- a/tests/test_program_numbers.py +++ b/tests/test_program_numbers.py @@ -465,6 +465,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', @@ -478,6 +484,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") |
