Skip to content

Commit d959ee0

Browse files
[MIG] helpdesk_mgmt_assign_method: Migration to 18.0
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 3d452e0 commit d959ee0

17 files changed

Lines changed: 1131 additions & 0 deletions
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
===========================
2+
Helpdesk Mgmt Assign Method
3+
===========================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:801b3c6c99d8b6c04f1f4be1541e97c256d0c96b0574a5c25673af9d72f0f15d
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fhelpdesk-lightgray.png?logo=github
20+
:target: https://github.com/OCA/helpdesk/tree/18.0/helpdesk_mgmt_assign_method
21+
:alt: OCA/helpdesk
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/helpdesk-18-0/helpdesk-18-0-helpdesk_mgmt_assign_method
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/helpdesk&target_branch=18.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
This module adds advanced ticket assignment methods to Odoo Helpdesk
32+
teams. You can configure each team to assign tickets manually, randomly,
33+
balanced (least open tickets), or sequentially (round-robin). Automatic
34+
assignment only works if users are assigned to the team. The responsible
35+
user is set automatically when creating or updating tickets, improving
36+
workflow and team efficiency.
37+
38+
**Table of contents**
39+
40+
.. contents::
41+
:local:
42+
43+
Usage
44+
=====
45+
46+
1. Go to *Helpdesk > Teams* and select or create a team.
47+
2. In the team form, choose the **Assignment Method**: Manual, Randomly,
48+
Balanced, or Sequential.
49+
3. Add users to the team (required for automatic assignment).
50+
4. Save the team.
51+
52+
When creating a new ticket (from Kanban or form view):
53+
54+
- Select the team for the ticket.
55+
56+
- The responsible user will be automatically assigned based on the
57+
team's assignment method:
58+
59+
- **Manual**: No automatic assignment; you must select the user
60+
manually.
61+
- **Randomly**: The ticket is assigned to a team member in a fair
62+
random order.
63+
- **Balanced**: The ticket is assigned to the user with the fewest
64+
open tickets.
65+
- **Sequential**: The ticket is assigned in round-robin order among
66+
team members.
67+
68+
Note: - If no users are assigned to the team, only the manual method is
69+
available. - Changing the team on a ticket will re-trigger the
70+
assignment logic.
71+
72+
Bug Tracker
73+
===========
74+
75+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/helpdesk/issues>`_.
76+
In case of trouble, please check there if your issue has already been reported.
77+
If you spotted it first, help us to smash it by providing a detailed and welcomed
78+
`feedback <https://github.com/OCA/helpdesk/issues/new?body=module:%20helpdesk_mgmt_assign_method%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
79+
80+
Do not contact contributors directly about support or help with technical issues.
81+
82+
Credits
83+
=======
84+
85+
Authors
86+
-------
87+
88+
* Escodoo
89+
90+
Contributors
91+
------------
92+
93+
- `Escodoo <https://www.escodoo.com.br>`__:
94+
95+
- Marcel Savegnago <marcel.savegnago@escodoo.com.br>
96+
- Kaynnan Lemes <kaynnan.lemes@escodoo.com.br>
97+
98+
Maintainers
99+
-----------
100+
101+
This module is maintained by the OCA.
102+
103+
.. image:: https://odoo-community.org/logo.png
104+
:alt: Odoo Community Association
105+
:target: https://odoo-community.org
106+
107+
OCA, or the Odoo Community Association, is a nonprofit organization whose
108+
mission is to support the collaborative development of Odoo features and
109+
promote its widespread use.
110+
111+
This module is part of the `OCA/helpdesk <https://github.com/OCA/helpdesk/tree/18.0/helpdesk_mgmt_assign_method>`_ project on GitHub.
112+
113+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright 2025 - TODAY, Escodoo
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
{
5+
"name": "Helpdesk Mgmt Assign Method",
6+
"summary": """
7+
Helpdesk Assign Method""",
8+
"version": "18.0.1.0.0",
9+
"license": "AGPL-3",
10+
"author": "Escodoo,Odoo Community Association (OCA)",
11+
"website": "https://github.com/OCA/helpdesk",
12+
"depends": [
13+
"helpdesk_mgmt",
14+
],
15+
"data": [
16+
"views/helpdesk_ticket_team.xml",
17+
],
18+
}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * helpdesk_mgmt_assign_method
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 17.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"Last-Translator: \n"
10+
"Language-Team: \n"
11+
"MIME-Version: 1.0\n"
12+
"Content-Type: text/plain; charset=UTF-8\n"
13+
"Content-Transfer-Encoding: \n"
14+
"Plural-Forms: \n"
15+
16+
#. module: helpdesk_mgmt_assign_method
17+
#: model:ir.model.fields,field_description:helpdesk_mgmt_assign_method.field_helpdesk_ticket_team__assign_method
18+
msgid "Assignation Method"
19+
msgstr ""
20+
21+
#. module: helpdesk_mgmt_assign_method
22+
#: model:ir.model.fields,help:helpdesk_mgmt_assign_method.field_helpdesk_ticket_team__assign_method
23+
msgid ""
24+
"Automatic assignation method for new tickets:\n"
25+
"Manually: manual\n"
26+
"Randomly: randomly but everyone gets the same amount\n"
27+
"Balanced: to the person with the least amount of open tickets\n"
28+
"Sequential: ensuring an even distribution among team members"
29+
msgstr ""
30+
31+
#. module: helpdesk_mgmt_assign_method
32+
#: model:ir.model.fields.selection,name:helpdesk_mgmt_assign_method.selection__helpdesk_ticket_team__assign_method__balanced
33+
msgid "Balanced"
34+
msgstr ""
35+
36+
#. module: helpdesk_mgmt_assign_method
37+
#: model:ir.model,name:helpdesk_mgmt_assign_method.model_helpdesk_ticket
38+
msgid "Helpdesk Ticket"
39+
msgstr ""
40+
41+
#. module: helpdesk_mgmt_assign_method
42+
#: model:ir.model,name:helpdesk_mgmt_assign_method.model_helpdesk_ticket_team
43+
msgid "Helpdesk Ticket Team"
44+
msgstr ""
45+
46+
#. module: helpdesk_mgmt_assign_method
47+
#: model:ir.model.fields.selection,name:helpdesk_mgmt_assign_method.selection__helpdesk_ticket_team__assign_method__manual
48+
msgid "Manually"
49+
msgstr ""
50+
51+
#. module: helpdesk_mgmt_assign_method
52+
#: model:ir.model.fields.selection,name:helpdesk_mgmt_assign_method.selection__helpdesk_ticket_team__assign_method__randomly
53+
msgid "Randomly"
54+
msgstr ""
55+
56+
#. module: helpdesk_mgmt_assign_method
57+
#: model:ir.model.fields.selection,name:helpdesk_mgmt_assign_method.selection__helpdesk_ticket_team__assign_method__sequential
58+
msgid "Sequential"
59+
msgstr ""
60+
61+
#. module: helpdesk_mgmt_assign_method
62+
#. odoo-python
63+
#: code:addons/helpdesk_mgmt_assign_method/models/helpdesk_ticket_team.py:0
64+
#, python-format
65+
msgid "You must have team members assigned to change the assignation method."
66+
msgstr ""
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * helpdesk_mgmt_assign_method
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 16.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"PO-Revision-Date: 2025-11-21 12:42+0000\n"
10+
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
11+
"Language-Team: none\n"
12+
"Language: it\n"
13+
"MIME-Version: 1.0\n"
14+
"Content-Type: text/plain; charset=UTF-8\n"
15+
"Content-Transfer-Encoding: \n"
16+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
17+
"X-Generator: Weblate 5.10.4\n"
18+
19+
#. module: helpdesk_mgmt_assign_method
20+
#: model:ir.model.fields,field_description:helpdesk_mgmt_assign_method.field_helpdesk_ticket_team__assign_method
21+
msgid "Assignation Method"
22+
msgstr "Metodo assegnazione"
23+
24+
#. module: helpdesk_mgmt_assign_method
25+
#: model:ir.model.fields,help:helpdesk_mgmt_assign_method.field_helpdesk_ticket_team__assign_method
26+
msgid ""
27+
"Automatic assignation method for new tickets:\n"
28+
"Manually: manual\n"
29+
"Randomly: randomly but everyone gets the same amount\n"
30+
"Balanced: to the person with the least amount of open tickets\n"
31+
"Sequential: ensuring an even distribution among team members"
32+
msgstr ""
33+
"Metodo di assegnazione automatica per i nuovi ticket:\n"
34+
"Manuale: manuale\n"
35+
"Casuale: in modo casuale, ma tutti ricevono la stessa quantità\n"
36+
"Bilanciato: alla persona con il minor numero di ticket aperti\n"
37+
"Sequenziale: per garantire una distribuzione uniforme tra i membri del team"
38+
39+
#. module: helpdesk_mgmt_assign_method
40+
#: model:ir.model.fields.selection,name:helpdesk_mgmt_assign_method.selection__helpdesk_ticket_team__assign_method__balanced
41+
msgid "Balanced"
42+
msgstr "Bilanciato"
43+
44+
#. module: helpdesk_mgmt_assign_method
45+
#: model:ir.model,name:helpdesk_mgmt_assign_method.model_helpdesk_ticket
46+
msgid "Helpdesk Ticket"
47+
msgstr "Ticket assistenza clienti"
48+
49+
#. module: helpdesk_mgmt_assign_method
50+
#: model:ir.model,name:helpdesk_mgmt_assign_method.model_helpdesk_ticket_team
51+
msgid "Helpdesk Ticket Team"
52+
msgstr "Team ticket assistenza clienti"
53+
54+
#. module: helpdesk_mgmt_assign_method
55+
#: model:ir.model.fields.selection,name:helpdesk_mgmt_assign_method.selection__helpdesk_ticket_team__assign_method__manual
56+
msgid "Manually"
57+
msgstr "Manualmente"
58+
59+
#. module: helpdesk_mgmt_assign_method
60+
#: model:ir.model.fields.selection,name:helpdesk_mgmt_assign_method.selection__helpdesk_ticket_team__assign_method__randomly
61+
msgid "Randomly"
62+
msgstr "A caso"
63+
64+
#. module: helpdesk_mgmt_assign_method
65+
#: model:ir.model.fields.selection,name:helpdesk_mgmt_assign_method.selection__helpdesk_ticket_team__assign_method__sequential
66+
msgid "Sequential"
67+
msgstr "Sequenziale"
68+
69+
#. module: helpdesk_mgmt_assign_method
70+
#. odoo-python
71+
#: code:addons/helpdesk_mgmt_assign_method/models/helpdesk_ticket_team.py:0
72+
#, python-format
73+
msgid "You must have team members assigned to change the assignation method."
74+
msgstr ""
75+
"Bisogna avere i membri dei team assegnati per modificare il metodo di "
76+
"assegnazione."
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from . import helpdesk_ticket_team
2+
from . import helpdesk_ticket
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Copyright 2025 - TODAY, Kaynnan Lemes <kaynnan.lemes@escodoo.com.br>
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
from odoo import api, models
5+
6+
7+
class HelpdeskTicket(models.Model):
8+
_inherit = "helpdesk.ticket"
9+
10+
@api.model
11+
def default_get(self, fields_list):
12+
res = super().default_get(fields_list)
13+
team_id = res.get("team_id") or self.env.context.get("default_team_id")
14+
if not team_id:
15+
if "user_id" in res and "default_user_id" not in self.env.context:
16+
res.pop("user_id")
17+
return res
18+
if "user_id" in res and "default_user_id" not in self.env.context:
19+
res.pop("user_id")
20+
if (not fields_list or "user_id" in fields_list) and "user_id" not in res:
21+
team = self.env["helpdesk.ticket.team"].browse(team_id)
22+
if team.assign_method != "manual":
23+
res["user_id"] = team.get_new_user().id
24+
return res
25+
26+
@api.onchange("team_id")
27+
def _onchange_team_id(self):
28+
"""Assign user when team changes if not already set."""
29+
if self.team_id and not self.user_id:
30+
self.user_id = self.team_id.get_new_user()
31+
32+
@api.model_create_multi
33+
def create(self, vals_list):
34+
"""Assign user based on team on creation if not provided."""
35+
for vals in vals_list:
36+
team_id = vals.get("team_id")
37+
if not team_id:
38+
continue
39+
team = self.env["helpdesk.ticket.team"].browse(team_id)
40+
user_id = vals.get("user_id")
41+
if user_id:
42+
if (
43+
user_id not in team.user_ids.ids
44+
and team.assign_method != "manual"
45+
):
46+
vals["user_id"] = team.get_new_user().id
47+
elif team.assign_method != "manual":
48+
vals["user_id"] = team.get_new_user().id
49+
return super().create(vals_list)

0 commit comments

Comments
 (0)