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 2 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

@geomer198 geomer198 force-pushed the 16.0-t3822-helpdesk_mgmt_activity-add_module branch 2 times, most recently from 0154cbd to 778d114 Compare November 22, 2024 18:15
for record in self:
current_stage = record.stage_id
stages = team_stages.get(
record.team_id.id, self.env["helpdesk.ticket.stage"]
Copy link
Member

Choose a reason for hiding this comment

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

You should move self.env["helpdesk.ticket.stage"] out of the loop and assign it to a variable.

@ivs-cetmix ivs-cetmix force-pushed the 16.0-t3822-helpdesk_mgmt_activity-add_module branch from aa892b3 to 3882b01 Compare November 29, 2024 19:44
@geomer198 geomer198 force-pushed the 16.0-t3822-helpdesk_mgmt_activity-add_module branch from 08ffc9f to 48ca4b3 Compare December 2, 2024 15:37
Copy link
Member

@ivs-cetmix ivs-cetmix left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@ivs-cetmix ivs-cetmix left a comment

Choose a reason for hiding this comment

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

You need to ensure your module doesn't make tests falling.

@geomer198 geomer198 force-pushed the 16.0-t3822-helpdesk_mgmt_activity-add_module branch from bcdc9ec to faad8f5 Compare December 6, 2024 23:25
@geomer198
Copy link

You need to ensure your module doesn't make tests falling.

100% module does not cause tests to fail.

@geomer198 geomer198 force-pushed the 16.0-t3822-helpdesk_mgmt_activity-add_module branch from 2cc8f48 to faad8f5 Compare December 6, 2024 23:34
@ivs-cetmix
Copy link
Member

You need to ensure your module doesn't make tests falling.

100% module does not cause tests to fail.

What do you mean?

@geomer198
Copy link

You need to ensure your module doesn't make tests falling.

100% module does not cause tests to fail.

What do you mean?

I was push empty module and tests are broken again.
Because tests errors not because of this module.

Copy link
Member

@ivs-cetmix ivs-cetmix left a comment

Choose a reason for hiding this comment

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

Code review LGTM

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@geomer198 geomer198 force-pushed the 16.0-t3822-helpdesk_mgmt_activity-add_module branch from b7ba83c to b04dea8 Compare December 10, 2024 14:27
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 from b04dea8 to 1ef073b Compare December 10, 2024 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants