16.0 portal ticket priority #13

Closed
jscampucci wants to merge 17 commits from 16.0-portal-ticket-priority into 16.0
9 changed files with 171 additions and 0 deletions

47
.github/workflows/test.yml vendored Normal file
View File

@@ -0,0 +1,47 @@
name: Build
on:
push:
branches:
- 16.0
jobs:
test:
runs-on: ubuntu-22.04
container: ${{ matrix.container }}
name: ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- container: ghcr.io/oca/oca-ci/py3.10-odoo18.0:latest
name: test with Odoo
services:
postgres:
image: postgres:12.0
env:
POSTGRES_USER: odoo
POSTGRES_PASSWORD: odoo
POSTGRES_DB: odoo
ports:
- 5432:5432
env:
OCA_ENABLE_CHECKLOG_ODOO: "1"
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install addons and dependencies
run: oca_install_addons
- name: Check licenses
run: manifestoo -d . check-licenses
- name: Check development status
run: manifestoo -d . check-dev-status --default-dev-status=Beta
- name: Initialize test db
run: oca_init_test_database
- name: Run tests
run: oca_run_tests
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}

1
README.md Normal file
View File

@@ -0,0 +1 @@
Test codecov 4

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>

View File

@@ -0,0 +1,19 @@
# Testing dependencies
pytest>=7.0.0
pytest-cov>=4.0.0
pytest-mock>=3.10.0
# Odoo dependencies (if testing outside Odoo environment)
# odoo>=16.0,<17.0
# Additional testing utilities
coverage>=7.0.0
xmlrunner>=1.7.7
# Development dependencies
flake8>=6.0.0
black>=22.0.0
isort>=5.12.0
# Optional: for XML parsing/validation
lxml>=4.9.0

1
sonar-project.properties Normal file
View File

@@ -0,0 +1 @@
sonar.projectKey=jscampucci_helpdesk-tools_AZenYBWXjg71hCM4Kd7U