-
-
Notifications
You must be signed in to change notification settings - Fork 318
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
base: 16.0
Are you sure you want to change the base?
[16.0][ADD] helpdesk_mgmt_activity: new module #635
Conversation
03bd3a3
to
e7503f6
Compare
res_id = fields.Integer(string="Source Document", index=True) | ||
|
||
record_ref = fields.Reference( | ||
selection="_referenceable_models", |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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()
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 |
There was a problem hiding this comment.
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?
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}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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( |
There was a problem hiding this comment.
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"): |
There was a problem hiding this comment.
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)
822f89e
to
02d58b2
Compare
f9cd4f4
to
a605955
Compare
fb2bb1d
to
d949b2f
Compare
@@ -0,0 +1,7 @@ | |||
The module adds the following features: | |||
|
|||
- Refer a ticket to the Odoo model record |
There was a problem hiding this comment.
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
88642fd
to
76b5791
Compare
ca0d740
to
9779f75
Compare
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
Show button only in new stage
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
9779f75
to
390366f
Compare
To Configure Ticket's Stage on Activity State** | ||
=============================================== | ||
|
||
- Go to Helpdesk-->Configuration--Teams |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
The module adds the following features:
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.