-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #572 from ursais/16.0-add-helpdesk_ticket_type_team
[ADD] helpdesk_ticket_type_team
- Loading branch information
Showing
13 changed files
with
235 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg | ||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
:alt: License: AGPL-3 | ||
|
||
======== | ||
Overview | ||
======== | ||
|
||
This module restricts the visibility of helpdesk ticket types based on the teams assigned to them. | ||
|
||
Every ticket type can only have a single team assigned to it. | ||
|
||
Configuration | ||
============= | ||
|
||
* Go to Helpdesk/Configuration/Types to assign a team to the ticket types | ||
* Alternatively, you can go Helpdesk/Configuration/Teams, and inside the form view you can assign the ticket types to the team | ||
|
||
Usage | ||
===== | ||
|
||
* Assign ticket types to teams | ||
* When creating a new ticket, only the assigned ticket types will be visible when selecting the team | ||
|
||
Credits | ||
======= | ||
|
||
Contributors | ||
------------ | ||
|
||
Samuel Macias <smacias@opensourceintegrators.com> | ||
Maxime Chambreuil <mchambreuil@opensourceintegrators.com> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright (C) 2017 Open Source Integrators (https://www.opensourceintegrators.com) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
{ | ||
"name": "Helpdesk ticket type team", | ||
"version": "16.0.1.0.0", | ||
"license": "AGPL-3", | ||
"summary": "Limits the selection of helpdesk ticket types based on the team", | ||
"author": "Open Source Integrators", | ||
"maintainer": "Open Source Integrators", | ||
"website": "https://github.com/ursais/osi-addons", | ||
"depends": [ | ||
# Odoo + Enterprise | ||
"helpdesk", | ||
# OCA | ||
# osi-addons | ||
], | ||
"data": [ | ||
"views/helpdesk_view.xml", | ||
], | ||
"application": False, | ||
"maintainers": ["ursais"], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * helpdesk_ticket_type_team | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0+e-20230816\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-04-23 18:26+0000\n" | ||
"PO-Revision-Date: 2024-04-23 18:26+0000\n" | ||
"Last-Translator: \n" | ||
"Language-Team: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: \n" | ||
|
||
#. module: helpdesk_ticket_type_team | ||
#: model:ir.model.fields,field_description:helpdesk_ticket_type_team.field_helpdesk_team__ticket_type_ids | ||
msgid "Assigned ticket types" | ||
msgstr "Tipos de ticket asignados" | ||
|
||
#. module: helpdesk_ticket_type_team | ||
#: model:ir.model,name:helpdesk_ticket_type_team.model_helpdesk_team | ||
msgid "Helpdesk Team" | ||
msgstr "Equipo de Servicio de asistencia" | ||
|
||
#. module: helpdesk_ticket_type_team | ||
#: model:ir.model,name:helpdesk_ticket_type_team.model_helpdesk_ticket | ||
msgid "Helpdesk Ticket" | ||
msgstr "Ticket de Servicio de asistencia" | ||
|
||
#. module: helpdesk_ticket_type_team | ||
#: model:ir.model,name:helpdesk_ticket_type_team.model_helpdesk_ticket_type | ||
msgid "Helpdesk Ticket Type" | ||
msgstr "Tipo de ticket de Servicio de asistencia" | ||
|
||
#. module: helpdesk_ticket_type_team | ||
#: model:ir.model.fields,field_description:helpdesk_ticket_type_team.field_helpdesk_ticket_type__team_id | ||
#: model:ir.model.fields,field_description:helpdesk_ticket_type_team.field_res_users__team_ids | ||
msgid "Team" | ||
msgstr "Equipo" | ||
|
||
#. module: helpdesk_ticket_type_team | ||
#: model:ir.model,name:helpdesk_ticket_type_team.model_res_users | ||
msgid "User" | ||
msgstr "Usuario" |
47 changes: 47 additions & 0 deletions
47
helpdesk_ticket_type_team/i18n/helpdesk_ticket_type_team.pot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * helpdesk_ticket_type_team | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0+e-20230816\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-04-23 18:26+0000\n" | ||
"PO-Revision-Date: 2024-04-23 18:26+0000\n" | ||
"Last-Translator: \n" | ||
"Language-Team: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: \n" | ||
|
||
#. module: helpdesk_ticket_type_team | ||
#: model:ir.model.fields,field_description:helpdesk_ticket_type_team.field_helpdesk_team__ticket_type_ids | ||
msgid "Assigned ticket types" | ||
msgstr "" | ||
|
||
#. module: helpdesk_ticket_type_team | ||
#: model:ir.model,name:helpdesk_ticket_type_team.model_helpdesk_team | ||
msgid "Helpdesk Team" | ||
msgstr "" | ||
|
||
#. module: helpdesk_ticket_type_team | ||
#: model:ir.model,name:helpdesk_ticket_type_team.model_helpdesk_ticket | ||
msgid "Helpdesk Ticket" | ||
msgstr "" | ||
|
||
#. module: helpdesk_ticket_type_team | ||
#: model:ir.model,name:helpdesk_ticket_type_team.model_helpdesk_ticket_type | ||
msgid "Helpdesk Ticket Type" | ||
msgstr "" | ||
|
||
#. module: helpdesk_ticket_type_team | ||
#: model:ir.model.fields,field_description:helpdesk_ticket_type_team.field_helpdesk_ticket_type__team_id | ||
#: model:ir.model.fields,field_description:helpdesk_ticket_type_team.field_res_users__team_ids | ||
msgid "Team" | ||
msgstr "" | ||
|
||
#. module: helpdesk_ticket_type_team | ||
#: model:ir.model,name:helpdesk_ticket_type_team.model_res_users | ||
msgid "User" | ||
msgstr "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from . import helpdesk_ticket | ||
from . import helpdesk_ticket_type | ||
from . import helpdesk_team | ||
from . import res_users |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Copyright (C) 2023 Open Source Integrators | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
from odoo import fields, models | ||
|
||
|
||
class HelpdeskTeam(models.Model): | ||
_inherit = "helpdesk.team" | ||
|
||
ticket_type_ids = fields.One2many( | ||
"helpdesk.ticket.type", "team_id", string="Assigned ticket types" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright (C) 2023 Open Source Integrators | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
from odoo import api, models | ||
|
||
|
||
class HelpdeskTicket(models.Model): | ||
_inherit = "helpdesk.ticket" | ||
|
||
@api.onchange("team_id") | ||
def _onchange_team_id(self): | ||
self.ticket_type_id = False | ||
self.user_id = False | ||
if not self.team_id or not self.team_id.ticket_type_ids: | ||
return {"domain": {"ticket_type_id": [("team_id", "=", False)]}} | ||
else: | ||
return { | ||
"domain": { | ||
"ticket_type_id": [("team_id", "=", self.team_id.id)], | ||
"user_id": [("team_ids", "=", self.team_id.id)], | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Copyright (C) 2023 Open Source Integrators | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
from odoo import fields, models | ||
|
||
|
||
class HelpdeskTicketType(models.Model): | ||
_inherit = "helpdesk.ticket.type" | ||
|
||
team_id = fields.Many2one("helpdesk.team", string="Team") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from odoo import fields, models | ||
|
||
|
||
class ResUsers(models.Model): | ||
_inherit = "res.users" | ||
|
||
team_ids = fields.Many2many("helpdesk.team") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<odoo> | ||
|
||
<record id="view_helpdesk_ticket_type_tree_inherit_mppd" model="ir.ui.view"> | ||
<field name="name">helpdesk.ticket.type.tree.inherit.mppd</field> | ||
<field name="model">helpdesk.ticket.type</field> | ||
<field name="inherit_id" ref="helpdesk.helpdesk_ticket_type_view_tree" /> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//field[@name='name']" position="after"> | ||
<field name="team_id" /> | ||
</xpath> | ||
</field> | ||
</record> | ||
|
||
<record id="view_helpdesk_team_form_inherit_mppd" model="ir.ui.view"> | ||
<field name="name">helpdesk.team.form.inherit.mppd</field> | ||
<field name="model">helpdesk.team</field> | ||
<field name="inherit_id" ref="helpdesk.helpdesk_team_view_form" /> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//field[@name='description']" position="after"> | ||
<field name="ticket_type_ids" /> | ||
</xpath> | ||
</field> | ||
</record> | ||
|
||
</odoo> |
1 change: 1 addition & 0 deletions
1
setup/helpdesk_ticket_type_team/odoo/addons/helpdesk_ticket_type_team
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../helpdesk_ticket_type_team |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import setuptools | ||
|
||
setuptools.setup( | ||
setup_requires=['setuptools-odoo'], | ||
odoo_addon=True, | ||
) |