Skip to content

Commit

Permalink
[ADD] helpdesk_ticket_close_inactive
Browse files Browse the repository at this point in the history
  • Loading branch information
miquelalzanillas committed Oct 31, 2024
1 parent 41e07ff commit ced985f
Show file tree
Hide file tree
Showing 19 changed files with 758 additions and 0 deletions.
111 changes: 111 additions & 0 deletions helpdesk_ticket_close_inactive/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
==============================
Helpdesk Ticket Close Inactive
==============================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:fe4b693ffaab7f2878056b4198a7552f97e7b1335467c53193700be7e5533b85
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png
:target: https://odoo-community.org/page/development-status
:alt: Alpha
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fhelpdesk-lightgray.png?logo=github
:target: https://github.com/OCA/helpdesk/tree/16.0/helpdesk_ticket_close_inactive
:alt: OCA/helpdesk
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/helpdesk-16-0/helpdesk-16-0-helpdesk_ticket_close_inactive
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/helpdesk&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

Adds an option to configure a cron job that automatically closes
inactive helpdesk tickets after a specified number of days, set in the
helpdesk team settings. Sends notification emails to the customer
(partner) and assigned team members, providing a warning after an
initial period of inactivity and a final closure notification when the
maximum inactivity period is reached.

.. IMPORTANT::
This is an alpha version, the data model and design can change at any time without warning.
Only for development or testing purpose, do not use in production.
`More details on development status <https://odoo-community.org/page/development-status>`_

**Table of contents**

.. contents::
:local:

Configuration
=============

To configure this module, you need to:

- Go to Helpdesk > Settings > Teams.
- Select a team.
- Enable 'Auto Close Inactive Ticket' option.
- Set number of days to be reached before send a warning notification to
the partner.
- Set warning email template or use the one provided by default.
- Set number of days to be reached before closing ticket.
- Set closing email template or use the one provided by default.
- Set stages to be filtered on the domain to execute action.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/helpdesk/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/helpdesk/issues/new?body=module:%20helpdesk_ticket_close_inactive%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* APSL-Nagarro

Contributors
------------

- ``APSL-Nagarro <https://apsl.tech>``\ \_:

- Miquel Alzanillas miquel.alzanillas@nagarro.com

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

.. |maintainer-miquelalzanillas| image:: https://github.com/miquelalzanillas.png?size=40px
:target: https://github.com/miquelalzanillas
:alt: miquelalzanillas

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-miquelalzanillas|

This module is part of the `OCA/helpdesk <https://github.com/OCA/helpdesk/tree/16.0/helpdesk_ticket_close_inactive>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions helpdesk_ticket_close_inactive/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import models
21 changes: 21 additions & 0 deletions helpdesk_ticket_close_inactive/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright <YEAR(S)> <AUTHOR(S)>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Helpdesk Ticket Close Inactive",
"version": "16.0.1.0.0",
"development_status": "Alpha",
"category": "Helpdesk",
"website": "https://github.com/OCA/helpdesk",
"author": "APSL-Nagarro, Odoo Community Association (OCA)",
"maintainers": ["miquelalzanillas"],
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": [
"helpdesk_mgmt",
],
"data": [
"views/helpdesk_ticket_team.xml",
"data/helpdesk_data.xml",
],
}
129 changes: 129 additions & 0 deletions helpdesk_ticket_close_inactive/data/helpdesk_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="ir_cron_close_inactive_tickets" model="ir.cron">
<field name="name">Close Inactive Tickets</field>
<field name="active" eval="True" />
<field name="model_id" ref="helpdesk_mgmt.model_helpdesk_ticket_team" />
<field name="state">code</field>
<field name="code">
model.action_inactive_tickets()
</field>
<field name="user_id" ref="base.user_root" />
<field name="interval_number">1</field>
<field name="interval_type">days</field>
<field name="numbercall">-1</field>
<field
name="nextcall"
eval="(DateTime.now() + timedelta(minutes=1)).strftime('%Y-%m-%d %H:%M:%S')"
/>
<field name="doall">0</field>
</record>
<record id="warning_inactive_ticket_template" model="mail.template">
<field name="name">Helpdesk Warning Ticket Notification Email</field>
<field name="model_id" ref="helpdesk_mgmt.model_helpdesk_ticket" />
<field name="email_from">{{object.company_id.partner_id.email}}</field>
<field
name="email_cc"
>{{not object.partner_id and object.partner_email or ''}},</field>
<field name="subject">The ticket {{object.number}} will be closed.</field>
<field name="partner_to">{{object.partner_id.id}}</field>
<field name="auto_delete" eval="False" />
<field name="lang">{{object.partner_id.lang}}</field>
<field name="body_html" type="html">
<table
border="0"
width="100%"
cellpadding="0"
bgcolor="#ededed"
style="padding: 20px; background-color: #ededed; border-collapse:separate;"
>
<tbody>
<!-- HEADER -->
<tr>
<td align="center" style="min-width: 590px;">
<table
width="590"
border="0"
cellpadding="0"
bgcolor="#875A7B"
style="min-width: 590px; background-color: rgb(135,90,123); padding: 20px; border-collapse:separate;"
>
<tr>
<td valign="middle" align="right">
<img
t-att-src="'/logo.png?company=%s' % object.company_id.id"
style="padding: 0px; margin: 0px; height: auto; width: 80px;"
t-att-alt="'%s' % object.company_id.name"
/>
</td>
</tr>
</table>
</td>
</tr>
<!-- CONTENT -->
<tr>
<td align="center" style="min-width: 590px;">
<table
width="590"
border="0"
cellpadding="0"
bgcolor="#ffffff"
style="min-width: 590px; background-color: rgb(255, 255, 255); padding: 20px; border-collapse:separate;"
>
<tbody>
<td
valign="top"
style="font-family:Arial,Helvetica,sans-serif; color: #555; font-size: 14px;"
>
<p>Hello <t t-out="object.user_id.name" />,</p>
<p>This ticket "<t
t-out="object.display_name"
/>" will be closed in <t
t-out="ctx.get('remaining_days')"
/> days if it is not updated .</p>
</td>
</tbody>
</table>
</td>
</tr>
<!-- FOOTER -->
<tr>
<td align="center" style="min-width: 590px;">
<table
width="590"
border="0"
cellpadding="0"
bgcolor="#875A7B"
style="min-width: 590px; background-color: rgb(135,90,123); padding: 20px; border-collapse:separate;"
>
<tr>
<td
valign="middle"
align="left"
style="color: #fff; padding-top: 10px; padding-bottom: 10px; font-size: 12px;"
>
<t t-out="object.company_id.phone" />
</td>
<td
valign="middle"
align="left"
style="color: #fff; padding-top: 10px; padding-bottom: 10px; font-size: 12px;"
>
<t t-out="object.company_id.email" />
</td>
<td
valign="middle"
align="left"
style="color: #fff; padding-top: 10px; padding-bottom: 10px; font-size: 12px;"
>
<t t-out="object.company_id.website" />
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
</field>
</record>
</odoo>
Empty file.
3 changes: 3 additions & 0 deletions helpdesk_ticket_close_inactive/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import helpdesk_ticket_team
Loading

0 comments on commit ced985f

Please sign in to comment.