Skip to content

Commit

Permalink
[REF] account_global_discount: adapt test to make it working if accou…
Browse files Browse the repository at this point in the history
…nt_invoice_triple_discount is installed
  • Loading branch information
legalsylvain committed Nov 12, 2024
1 parent b30bbe8 commit e03dba3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion account_global_discount/tests/test_global_discount.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,12 @@ def test_01_global_invoice_succesive_discounts(self):
# The global discounts amount is then 160 - 56 = 104
with Form(self.invoice) as invoice_form:
with invoice_form.invoice_line_ids.edit(0) as line_form:
line_form.discount = 20
# Make the test compatible if account_invoice_triple_discount
# is installed
if "discount1" in line_form._model._fields:
line_form.discount1 = 20
else:
line_form.discount = 20
self.assertEqual(len(self.invoice.invoice_global_discount_ids), 2)
invoice_tax_line = self.invoice.line_ids.filtered("tax_line_id")
self.assertAlmostEqual(invoice_tax_line.tax_base_amount, 56.0)
Expand Down

0 comments on commit e03dba3

Please sign in to comment.