[ADD] helpdesk_portal_ticket_custom: add priority to portal ticket list

This commit is contained in:
jscampucci
2025-07-09 10:53:15 +02:00
parent 63a2c8f28f
commit 95a69671dd
5 changed files with 103 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
*.*~
*pyc

View File

@@ -0,0 +1,37 @@
====================================
helpdesk_portal_ticket_custom
====================================
Customization for ticket portal view.
# Installation
Use Odoo normal module installation procedure to install
`helpdesk_portal_ticket_custom`.
# Known issues / Roadmap
None yet.
# Bug Tracker
Bugs are tracked on `our issues website <https://github.com/elabore-coop/helpdesk-tools/issues>`\_. In case of
trouble, please check there if your issue has already been
reported. If you spotted it first, help us smashing it by providing a
detailed and welcomed feedback.
# Credits
## Contributors
- Joris Scampucci
## Funders
The development of this module has been financially supported by:
- Elabore (https://elabore.coop)
## Maintainer
This module is maintained by Elabore.

View File

@@ -0,0 +1,35 @@
# Copyright 2024 Joris Scampucci" (Elabore)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "helpdesk_portal_ticket_custom",
"version": "16.0.1.0.0",
"author": "Elabore",
"website": "https://elabore.coop",
"maintainer": "Joris Scampucci",
"license": "AGPL-3",
"category": "Tools",
"summary": "Customization for ticket portal view.",
# any module necessary for this one to work correctly
"depends": [
"base",
"helpdesk_mgmt",
],
"qweb": [],
"external_dependencies": {
"python": [],
},
# always loaded
"data": [
"views/portal_ticket_views.xml",
],
# only loaded in demonstration mode
"demo": [],
"js": [],
"css": [],
"installable": True,
# Install this module automatically if all dependency have been previously
# and independently installed. Used for synergetic or glue modules.
"auto_install": False,
"application": False,
}

View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="ticket_priority_widget_template" name="Priority Widget Template">
<span t-attf-class="o_priority_star fa fa-star#{'' if ticket.priority >= ticket_priority else '-o'}" t-attf-title="Priorité: {{'Très haute' if ticket.priority == '3' else 'Haute' if ticket.priority == '2' else 'Moyenne' if ticket.priority == '1' else 'Basse'}}" />
</template>
<!-- Ticket portal list -->
<template id="portal_ticket_list_inherit" inherit_id="helpdesk_mgmt.portal_ticket_list" priority="1">
<!-- Add priority field -->
<xpath expr="//thead/tr/th[2]" position="after">
<th>Priorité</th>
</xpath>
<xpath expr="//tbody/t/tr/td[2]" position="after">
<td>
<t t-call="helpdesk_portal_ticket_custom.ticket_priority_widget_template">
<t t-set="ticket_priority" t-value="'1'"/>
</t>
<t t-call="helpdesk_portal_ticket_custom.ticket_priority_widget_template">
<t t-set="ticket_priority" t-value="'2'"/>
</t>
<t t-call="helpdesk_portal_ticket_custom.ticket_priority_widget_template">
<t t-set="ticket_priority" t-value="'3'"/>
</t>
</td>
</xpath>
</template>
</odoo>