-
-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] helpdesk_mgmt_activity: new module
- Loading branch information
1 parent
79edc7b
commit 0e19278
Showing
21 changed files
with
803 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,114 @@ | ||
============================ | ||
Helpdesk Management Activity | ||
============================ | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:c77bb124906154be8648020f75af1b6c2dca2c419551445c18e60b86488fe429 | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png | ||
:target: https://odoo-community.org/page/development-status | ||
:alt: Beta | ||
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png | ||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
:alt: License: AGPL-3 | ||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fhelpdesk-lightgray.png?logo=github | ||
:target: https:/OCA/helpdesk/tree/16.0/helpdesk_mgmt_activity | ||
:alt: OCA/helpdesk | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/helpdesk-16-0/helpdesk-16-0-helpdesk_mgmt_activity | ||
:alt: Translate me on Weblate | ||
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png | ||
:target: https://runboat.odoo-community.org/builds?repo=OCA/helpdesk&target_branch=16.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
The module adds the following features: | ||
|
||
- Refer a ticket to the Odoo model record | ||
- Set the list of models available for a Helpdesk team | ||
- Create an activity for the referring record right from the Ticket | ||
- Change the Ticket's stage based on the activity state | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Configuration | ||
============= | ||
|
||
**To Configure Available Odoo Models for a Team** | ||
|
||
- Go to Helpdesk-->Configuration-->Teams | ||
- Create a Team or select an existing record | ||
- In the Binding Models field add models available for a team | ||
|
||
**To Configure Ticket's Stage on Activity State** | ||
|
||
- Go to Helpdesk-->Configuration-->Stages | ||
- Create a New stage or select an existing record | ||
- Enable the "Closed Activity Stage" checkbox | ||
|
||
Usage | ||
===== | ||
|
||
**Go to Helpdesk module** | ||
|
||
- Select a Team | ||
- Open a Ticket | ||
- Create a new Ticket | ||
- Select a related model | ||
- Select a record for a related model | ||
- Select Activity type, user, and due date | ||
- By moving the Ticket to an 'in progress' state activity will be created in the related model | ||
- If an activity was closed, the Ticket moves to the pre-defined stage | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https:/OCA/helpdesk/issues>`_. | ||
In case of trouble, please check there if your issue has already been reported. | ||
If you spotted it first, help us to smash it by providing a detailed and welcomed | ||
`feedback <https:/OCA/helpdesk/issues/new?body=module:%20helpdesk_mgmt_activity%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
|
||
Do not contact contributors directly about support or help with technical issues. | ||
|
||
Credits | ||
======= | ||
|
||
Authors | ||
~~~~~~~ | ||
|
||
* Cetmix OÜ | ||
|
||
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
* `Cetmix OÜ <https://cetmix.com>`_: | ||
|
||
* Ivan Sokolov | ||
* Mikhail Lapin | ||
* Dessan Hemrayev | ||
|
||
Maintainers | ||
~~~~~~~~~~~ | ||
|
||
This module is maintained by the OCA. | ||
|
||
.. image:: https://odoo-community.org/logo.png | ||
:alt: Odoo Community Association | ||
:target: https://odoo-community.org | ||
|
||
OCA, or the Odoo Community Association, is a nonprofit organization whose | ||
mission is to support the collaborative development of Odoo features and | ||
promote its widespread use. | ||
|
||
This module is part of the `OCA/helpdesk <https:/OCA/helpdesk/tree/16.0/helpdesk_mgmt_activity>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
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 @@ | ||
# Copyright (C) 2024 Cetmix OÜ | ||
# 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,18 @@ | ||
# Copyright (C) 2024 Cetmix OÜ | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "Helpdesk Management Activity", | ||
"summary": "Create Activities for Odoo records from the Helpdesk", | ||
"version": "16.0.1.0.0", | ||
"license": "AGPL-3", | ||
"author": "Cetmix OÜ, Odoo Community Association (OCA)", | ||
"website": "https:/OCA/helpdesk", | ||
"depends": ["helpdesk_mgmt"], | ||
"data": [ | ||
"views/helpdesk_ticket_stage_view.xml", | ||
"views/helpdesk_ticket_view.xml", | ||
"views/helpdesk_ticket_team_views.xml", | ||
], | ||
"application": False, | ||
} |
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 @@ | ||
# Copyright (C) 2024 Cetmix OÜ | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from . import helpdesk_ticket | ||
from . import helpdesk_ticket_stage | ||
from . import helpdesk_ticket_team | ||
from . import mail_activity |
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,24 @@ | ||
# Copyright (C) 2024 Cetmix OÜ | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
|
||
from odoo import api, fields, models | ||
|
||
|
||
class HelpdeskTicket(models.Model): | ||
_inherit = "helpdesk.ticket" | ||
|
||
source_document = fields.Reference( | ||
selection="_select_target_model", string="Record" | ||
) | ||
|
||
@api.model | ||
def _select_target_model(self): | ||
team_id = self.env["helpdesk.ticket.team"].browse( | ||
self.env.context.get("active_id") | ||
) | ||
model_ids = team_id.avaible_model_ids | ||
models = self.env["ir.model"].search( | ||
[("id", "in", model_ids.ids if model_ids else [])] | ||
) | ||
return [(model.model, model.name) for model in 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,10 @@ | ||
from odoo import fields, models | ||
|
||
|
||
class HelpdeskTicketStage(models.Model): | ||
_inherit = "helpdesk.ticket.stage" | ||
|
||
is_closed_activity_stage = fields.Boolean( | ||
string="Closed Activity Stage", | ||
help="If checked, this stage will be set when a related activity is closed.", | ||
) |
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 HelpdeskTicketTeam(models.Model): | ||
_inherit = "helpdesk.ticket.team" | ||
|
||
avaible_model_ids = fields.Many2many("ir.model") |
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,43 @@ | ||
from odoo import api, models | ||
|
||
|
||
class MailActivity(models.Model): | ||
_inherit = "mail.activity" | ||
|
||
@api.model | ||
def _get_closed_activity_stage(self): | ||
stages = self.env["helpdesk.ticket.stage"].search( | ||
[("is_closed_activity_stage", "=", True)] | ||
) | ||
return stages[0] if stages else False | ||
|
||
def _action_done(self, feedback=False, attachment_ids=None): | ||
related_tickets = self.env["helpdesk.ticket"].search( | ||
[("source_document", "=", f"{self.res_model},{self.res_id}")] | ||
) | ||
closed_activity_stage = self._get_closed_activity_stage() | ||
for ticket in related_tickets: | ||
if closed_activity_stage: | ||
ticket.stage_id = closed_activity_stage.id | ||
return super()._action_done(feedback, attachment_ids) | ||
|
||
@api.model | ||
def create(self, vals): | ||
ticket_model = ( | ||
self.env["ir.model"] | ||
.sudo() | ||
.search([("model", "=", "helpdesk.ticket")], limit=1) | ||
) | ||
ticket_obj = self.env["helpdesk.ticket"] | ||
|
||
if vals.get("res_model_id", 0) == ticket_model.id: | ||
ticket = ticket_obj.browse(vals.get("res_id")) | ||
if ticket and ticket.source_document: | ||
ticket.source_document.activity_schedule( | ||
activity_type_id=vals.get("activity_type_id"), | ||
summary=vals.get("summary"), | ||
note=vals.get("note"), | ||
user_id=vals.get("user_id"), | ||
) | ||
|
||
return super().create(vals) | ||
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 @@ | ||
**To Configure Available Odoo Models for a Team** | ||
|
||
- Go to Helpdesk-->Configuration-->Teams | ||
- Create a Team or select an existing record | ||
- In the Binding Models field add models available for a team | ||
|
||
**To Configure Ticket's Stage on Activity State** | ||
|
||
- Go to Helpdesk-->Configuration-->Stages | ||
- Create a New stage or select an existing record | ||
- Enable the "Closed Activity Stage" checkbox |
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,5 @@ | ||
* `Cetmix OÜ <https://cetmix.com>`_: | ||
|
||
* Ivan Sokolov | ||
* Mikhail Lapin | ||
* Dessan Hemrayev |
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 @@ | ||
The module adds the following features: | ||
|
||
- Refer a ticket to the Odoo model record | ||
- Set the list of models available for a Helpdesk team | ||
- Create an activity for the referring record right from the Ticket | ||
- Change the Ticket's stage based on the activity state |
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,10 @@ | ||
**Go to Helpdesk module** | ||
|
||
- Select a Team | ||
- Open a Ticket | ||
- Create a new Ticket | ||
- Select a related model | ||
- Select a record for a related model | ||
- Select Activity type, user, and due date | ||
- By moving the Ticket to an 'in progress' state activity will be created in the related model | ||
- If an activity was closed, the Ticket moves to the pre-defined stage |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.