Skip to content

Commit

Permalink
[FIX] account_invoice_section_sale_order: fix test-case test_create_i…
Browse files Browse the repository at this point in the history
…nvoice_with_currency
  • Loading branch information
Lukas Tran committed Dec 31, 2024
1 parent 678ad54 commit 17292ca
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions account_invoice_section_sale_order/tests/common.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from odoo.tests import tagged
from odoo.tests.common import SavepointCase
from odoo.tests.common import TransactionCase


@tagged("-at_install", "post_install")
class Common(SavepointCase):
class Common(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ def test_create_invoice(self):
"".join([self.order1_p1.name, " - ", self.order1_p1.client_order_ref]),
"line_section",
),
20: ("order 1 line 1", False),
30: ("order 1 line 2", False),
20: ("order 1 line 1", "product"),
30: ("order 1 line 2", "product"),
40: (self.order2_p1.name, "line_section"),
50: ("order 2 line 1", False),
60: ("order 2 line 2", False),
50: ("order 2 line 1", "product"),
60: ("order 2 line 2", "product"),
}
invoice_ids = (self.order1_p1 + self.order2_p1)._create_invoices()
lines = invoice_ids[0].invoice_line_ids.sorted("sequence")
Expand All @@ -38,7 +38,7 @@ def test_create_invoice_with_currency(self):
"""Check invoice is generated with a correct total amount"""
orders = self.order1_p1 | self.order2_p1
invoices = orders._create_invoices()
self.assertEqual(invoices.amount_total, 80)
self.assertEqual(invoices.amount_untaxed, 80)

def test_create_invoice_with_default_journal(self):
"""Using a specific journal for the invoice should not be broken"""
Expand Down Expand Up @@ -98,13 +98,13 @@ def test_custom_grouping_by_sale_order_user(self):
invoice = (orders + sale_order_3)._create_invoices()
result = {
10: ("Mocked value from ResUsers", "line_section"),
20: ("order 1 line 1", False),
30: ("order 1 line 2", False),
40: ("order 2 line 1", False),
50: ("order 2 line 2", False),
20: ("order 1 line 1", "product"),
30: ("order 1 line 2", "product"),
40: ("order 2 line 1", "product"),
50: ("order 2 line 2", "product"),
60: ("Mocked value from ResUsers", "line_section"),
70: ("order 3 line 1", False),
80: ("order 3 line 2", False),
70: ("order 3 line 1", "product"),
80: ("order 3 line 2", "product"),
}
for line in invoice.invoice_line_ids.sorted("sequence"):
if line.sequence not in result:
Expand Down

0 comments on commit 17292ca

Please sign in to comment.