Skip to content

Commit 2e9698c

Browse files
committed
Merge PR OCA#1203 into 16.0
Signed-off-by etobella
2 parents cd1f1a8 + 9afafcb commit 2e9698c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

contract_variable_qty_timesheet/tests/test_contract_variable_qty_timesheet.py

+11
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,24 @@
22
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
33

44
from odoo import fields
5+
from odoo.tests import tagged
56
from odoo.tests.common import TransactionCase
67

78

9+
@tagged("post_install", "-at_install")
810
class TestContractVariableQtyTimesheet(TransactionCase):
911
@classmethod
1012
def setUpClass(cls):
1113
super().setUpClass()
14+
if not cls.env.company.chart_template_id:
15+
# Load a CoA if there's none in current company
16+
coa = cls.env.ref("l10n_generic_coa.configurable_chart_template", False)
17+
if not coa:
18+
# Load the first available CoA
19+
coa = cls.env["account.chart.template"].search(
20+
[("visible", "=", True)], limit=1
21+
)
22+
coa.try_loading(company=cls.env.company, install_demo=False)
1223
cls.company = cls.env.company
1324
cls.partner = cls.env["res.partner"].create(
1425
{"name": "Test partner", "company_id": cls.company.id}

0 commit comments

Comments
 (0)