Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][IMP] helpdesk_mgmt: Add specific use cases with team without company_id #621

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions helpdesk_mgmt/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def setUpClass(cls):
"mail_notrack": True,
"no_reset_password": True,
}
cls.company = cls.env.company
cls.user_own = new_test_user(
cls.env,
login="helpdesk_mgmt-user_own",
Expand Down
50 changes: 50 additions & 0 deletions helpdesk_mgmt/tests/test_helpdesk_ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,56 @@ def setUpClass(cls):
super().setUpClass()
cls.ticket = cls.ticket_a_unassigned

def test_helpdesk_ticket_team_company(self):
ticket_a = self.env["helpdesk.ticket"].create(
{
"name": "Test ticket A",
"team_id": self.team_a.id,
"description": "description",
}
)
self.assertEqual(ticket_a.company_id, self.company)
self.team_b.company_id = False
ticket_b = self.env["helpdesk.ticket"].create(
{
"name": "Test ticket b",
"team_id": self.team_b.id,
"description": "description",
}
)
self.assertEqual(ticket_b.company_id, self.company)

def test_helpdesk_ticket_team_company_extra(self):
company = self.env["res.company"].create({"name": "Test company"})
team = self.env["helpdesk.ticket.team"].create(
{"name": "Test team", "company_id": False}
)
ticket = (
self.env["helpdesk.ticket"]
.with_company(company)
.create(
{
"name": "Test ticket",
"team_id": team.id,
"description": "description",
}
)
)
self.assertEqual(ticket.company_id, company)
team.company_id = self.company
ticket = (
self.env["helpdesk.ticket"]
.with_company(company)
.create(
{
"name": "Test ticket",
"team_id": team.id,
"description": "description",
}
)
)
self.assertEqual(ticket.company_id, self.company)

def test_helpdesk_ticket_datetimes(self):
old_stage_update = self.ticket.last_stage_update
self.assertTrue(
Expand Down
Loading