Skip to content

Commit

Permalink
Merge PR #494 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Jul 27, 2023
2 parents d73cae1 + 7f0a9f5 commit 92b119d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 8 deletions.
7 changes: 6 additions & 1 deletion helpdesk_mgmt/models/helpdesk_ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class HelpdeskTicket(models.Model):
_name = "helpdesk.ticket"
_description = "Helpdesk Ticket"
_rec_name = "number"
_order = "priority desc, number desc, id desc"
_order = "priority desc, sequence, number desc, id desc"
_mail_post_access = "read"
_inherit = ["mail.thread.cc", "mail.activity.mixin", "portal.mixin"]

Expand Down Expand Up @@ -94,6 +94,11 @@ def _read_group_stage_ids(self, stages, domain, order):
("blocked", "Blocked"),
],
)
sequence = fields.Integer(
index=True,
default=10,
help="Gives the sequence order when displaying a list of tickets.",
)
active = fields.Boolean(default=True)

def name_get(self):
Expand Down
30 changes: 23 additions & 7 deletions helpdesk_mgmt/views/helpdesk_ticket_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@
widget="many2many_tags"
options="{'no_create_edit': True, 'color_field': 'color',}"
/>
<field name="sequence" groups="base.group_no_one" />
</group>
</group>
<notebook>
Expand Down Expand Up @@ -210,20 +211,34 @@
<field name="model">helpdesk.ticket</field>
<field name="arch" type="xml">
<tree>
<field name="number" />
<field name="name" />
<field name="partner_name" />
<field name="user_id" />
<field name="stage_id" />
<field name="priority" widget="priority" />
<field name="sequence" widget="handle" />
<field name="number" decoration-bf="1" />
<field name="name" />
<field name="partner_id" optional="hide" widget="many2one_avatar" />
<field name="partner_name" optional="show" />
<field name="user_id" optional="show" widget="many2one_avatar_user" />
<field name="unattended" invisible="1" />
<field name="closed" invisible="1" />
<field
name="tag_ids"
widget="many2many_tags"
options="{'color_field': 'color'}"
optional="show"
/>
<field name="create_date" readonly="1" />
<field name="last_stage_update" />
<field
name="last_stage_update"
widget="remaining_days"
optional="show"
/>
<field name="activity_ids" widget="list_activity" optional="hide" />
<field
name="stage_id"
widget="badge"
decoration-success="not unattended and not closed"
decoration-info="unattended == True"
decoration-muted="closed == True"
/>
</tree>
</field>
</record>
Expand All @@ -238,6 +253,7 @@
<field name="name" />
<field name="partner_name" />
<field name="user_id" />
<field name="sequence" />
<field name="color" />
<field name="stage_id" />
<field name="priority" widget="priority" />
Expand Down

0 comments on commit 92b119d

Please sign in to comment.