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][ADD] helpdesk_mgmt_activity: new module #635

Open
wants to merge 11 commits into
base: 16.0
Choose a base branch
from

Conversation

dessanhemrayev
Copy link

@dessanhemrayev dessanhemrayev commented Oct 6, 2024

The module adds the following features:

  • Set the list of models available for a Helpdesk
  • Refer the Odoo model record to the Helpdesk Ticket
  • Create an activity for the referring record right from the Helpdesk and move the ticket to the next state automatically
  • Move the Ticket to a pre-defined stage automatically when the referred activity created from the Helpdesk is marked as Done

To streamline your helpdesk operations you can set activities to the pre-configured odoo modules records right from the Helpdesk. The ticket will be moved to the pre-defined stage when the activity is marked as done.
For instance:
A customer reached out to the support team regarding a delayed shipment.

  • Assign Activity: The helpdesk support team user opens a ticket for the relevant Inventory picking record with specific instructions to check the shipment status and actions that must be taken.
  • Warehouse Action: The assigned warehouse user sees the new activity in their Odoo dashboard, follows the prescribed steps to investigate, and updates the activity status accordingly.
  • Automated Updates: Once the warehouse user marks the activity as done, the ticket automatically moves to the "Awaiting" stage to be checked by the support team use

@geomer198 geomer198 force-pushed the 16.0-t3822-helpdesk_mgmt_activity-add_module branch 5 times, most recently from 03bd3a3 to e7503f6 Compare October 14, 2024 15:11
res_id = fields.Integer(string="Source Document", index=True)

record_ref = fields.Reference(
selection="_referenceable_models",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please, rename to:

selection="_selection_record_ref"

string="Source Record",
)
source_activity_type_id = fields.Many2one(comodel_name="mail.activity.type")
date_deadline = fields.Date(string="Due Date", default=fields.Date.context_today)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are you use context_today format?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are you use context_today format?

I used the same format like date_deadline field format in mail.activity model.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@geomer198 in the case of an activity, it is assigned to a specific user and it makes sense to take into account the context of the time zone of this user, in the case of a ticket I think it is unnecessary, different users with different time zone can work with a ticket. so, we need use fields.Date.today()

Comment on lines 50 to 58
if rec.res_model and rec.res_id:
try:
self.env[rec.res_model].browse(rec.res_id).check_access_rule("read")
rec.record_ref = "%s,%s" % (
rec.res_model,
rec.res_id,
)
except Exception:
rec.record_ref = None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to reduce complexity in the code, you can do a little refactoring:

for rec in self:
    if not rec.res_model or not rec.res_id:
        rec.record_ref = None
        continue

    try:
        self.env[rec.res_model].browse(rec.res_id).check_access_rule("read")
        ...

what do you think about this?

Comment on lines 62 to 70
def _inverse_record_ref(self):
"""Set Source Document Reference"""
for record in self:
if record.record_ref:
res_id = record.record_ref.id
res_model = record.record_ref._name
else:
res_id, res_model = False, False
record.write({"res_id": res_id, "res_model": res_model})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def _inverse_record_ref(self):
"""Set Source Document Reference"""
for record in self:
if record.record_ref:
res_id = record.record_ref.id
res_model = record.record_ref._name
else:
res_id, res_model = False, False
record.write({"res_id": res_id, "res_model": res_model})
def _inverse_record_ref(self):
"""Set Source Document Reference"""
for record in self:
record_ref = record.record_ref
record.write({
"res_id": record_ref and record_ref.id or False,
"res_model": record_ref and record_ref._name or False,
})

class HelpdeskTicketTeam(models.Model):
_inherit = "helpdesk.ticket.team"

is_set_activity = fields.Boolean(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please, rename field to allow_set_activity


def _action_done(self, feedback=False, attachment_ids=None):
# Get closed stage for ticket
for ticket in self.mapped("ticket_id"):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Odoo 16.0 support mapping recordsets like this: for ticket in self.ticket_id:

if self is multi record set, then the self.ticket_id should return records: helpdesk.ticket(1, 2, 3)

@geomer198 geomer198 force-pushed the 16.0-t3822-helpdesk_mgmt_activity-add_module branch from 822f89e to 02d58b2 Compare October 16, 2024 11:08
@geomer198 geomer198 force-pushed the 16.0-t3822-helpdesk_mgmt_activity-add_module branch from f9cd4f4 to a605955 Compare October 17, 2024 06:32
@dessanhemrayev dessanhemrayev marked this pull request as ready for review October 17, 2024 11:29
@geomer198 geomer198 force-pushed the 16.0-t3822-helpdesk_mgmt_activity-add_module branch 2 times, most recently from fb2bb1d to d949b2f Compare October 21, 2024 11:35
@@ -0,0 +1,7 @@
The module adds the following features:

- Refer a ticket to the Odoo model record
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Link a ticket to an Odoo model record
  • Set the list of available models for a Helpdesk team
  • Pre-configure ticket description template based on it's category
  • Create an activity for the linked record right from the Ticket
  • Change the Ticket's stage based on the activity state

@geomer198 geomer198 force-pushed the 16.0-t3822-helpdesk_mgmt_activity-add_module branch 2 times, most recently from 88642fd to 76b5791 Compare November 4, 2024 16:58
@Bearnard21 Bearnard21 force-pushed the 16.0-t3822-helpdesk_mgmt_activity-add_module branch 3 times, most recently from ca0d740 to 9779f75 Compare November 8, 2024 10:07
@dessanhemrayev dessanhemrayev force-pushed the 16.0-t3822-helpdesk_mgmt_activity-add_module branch from 9779f75 to 390366f Compare November 12, 2024 16:21
To Configure Ticket's Stage on Activity State**
===============================================

- Go to Helpdesk-->Configuration--Teams
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like > is missing here: Configuration--Teams

===============================================

- Go to Helpdesk-->Configuration--Teams
- Create a "New" team or select an existing record
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does user need to create a team with the name "New" or a new team?

- Select a Team
- Open a Ticket
- Create a new Ticket
- In the "Assign Activity" group
Copy link
Member

@ivs-cetmix ivs-cetmix Nov 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a screenshot here too in order to show new fields in the ticket form

dessanhemrayev and others added 9 commits November 22, 2024 21:07
The module adds the following features:

- Set the list of models available for a Helpdesk
- Refer the Odoo model record to the Helpdesk Ticket
- Create an activity for the referring record right from the Helpdesk and move the ticket to the next state automatically
- Move the Ticket to a pre-defined stage automatically when the referred activity created from the Helpdesk is marked as Done

To streamline your helpdesk operations you can set activities to the pre-configured odoo modules records right from the Helpdesk. The ticket will be moved to the pre-defined stage when the activity is marked as done.
For instance:
A customer reached out to the support team regarding a delayed shipment.

- Assign Activity: The helpdesk support team user opens a ticket for the relevant Inventory picking record with specific instructions to check the shipment status and actions that must be taken.
- Warehouse Action: The assigned warehouse user sees the new activity in their Odoo dashboard, follows the prescribed steps to investigate, and updates the activity status accordingly.
- Automated Updates: Once the warehouse user marks the activity as done, the ticket automatically moves to the "Awaiting" stage to be checked by the support team use
…ded.

* is_set_activity field renamed to allow_set_activity
* _referenceable_models method is renamed to _selection_record_ref
* compute and inverce methods are updated
* move to next stage at the activity created from helpdesk ticket for source record functional is added
* tests for new functional is added
* views are updated
Default value for date_deadline field is updated from context_today() to today() method
At the click 'perform action' button not open activity wizard, and create activity automatically to source record.
…ixed and for activity set default activity user or current user
@geomer198 geomer198 force-pushed the 16.0-t3822-helpdesk_mgmt_activity-add_module branch from 1f9b204 to a9024cb Compare November 22, 2024 18:08
@geomer198 geomer198 force-pushed the 16.0-t3822-helpdesk_mgmt_activity-add_module branch from 0154cbd to 778d114 Compare November 22, 2024 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants