Skip to content

Commit 51659ff

Browse files
committed
[FIX][16.0] project_sequence: fix test : company's must be computed once to exist
1 parent 5684b02 commit 51659ff

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

project_sequence/tests/test_project_sequence.py

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,7 @@ def setUpClass(cls):
2020
)
2121
cls.pjr_seq = cls.env.ref("project_sequence.seq_project_sequence")
2222
cls.pjr_seq.date_range_ids.unlink()
23-
default_plan_id = (
24-
cls.env["account.analytic.plan"]
25-
.sudo()
26-
.search(
27-
[
28-
"|",
29-
("company_id", "=", False),
30-
("company_id", "=", cls.env.company.id),
31-
],
32-
limit=1,
33-
)
34-
)
23+
default_plan_id = cls.env.company.analytic_plan_id
3524
cls.analytic_account = cls.env["account.analytic.account"].create(
3625
{
3726
"name": "aaa",
@@ -175,18 +164,7 @@ def test_custom_pattern(self):
175164
def test_sync_analytic_account(self):
176165
"""Set analytic account name equal to project's display name."""
177166
proj = self.env["project.project"].create({"name": "one"})
178-
default_plan_id = (
179-
self.env["account.analytic.plan"]
180-
.sudo()
181-
.search(
182-
[
183-
"|",
184-
("company_id", "=", False),
185-
("company_id", "=", self.env.company.id),
186-
],
187-
limit=1,
188-
)
189-
)
167+
default_plan_id = self.env.company.analytic_plan_id
190168
analytic_account = self.env["account.analytic.account"].create(
191169
{
192170
"name": proj.display_name,

0 commit comments

Comments
 (0)