From f7b7d26992b158c46a8c4cdc99075b0b307f0e95 Mon Sep 17 00:00:00 2001 From: Anjeel Haria Date: Thu, 13 Feb 2025 18:13:29 +0530 Subject: [PATCH] Added helpdesk_mgmt_email,helpdesk_mgmt_fetchmail_multicompany and helpdesk_ticket_custom_priority modules --- helpdesk_mgmt_email/__init__.py | 1 + helpdesk_mgmt_email/__manifest__.py | 19 + helpdesk_mgmt_email/data/automated_action.xml | 16 + helpdesk_mgmt_email/data/mail_template.xml | 212 ++++++++++ helpdesk_mgmt_email/i18n/nl.po | 399 ++++++++++++++++++ helpdesk_mgmt_email/models/__init__.py | 2 + helpdesk_mgmt_email/models/helpdesk_ticket.py | 29 ++ .../models/helpdesk_ticket_team.py | 9 + .../views/helpdesk_ticket_team_view.xml | 13 + .../views/helpdesk_ticket_view.xml | 18 + .../__init__.py | 1 + .../__manifest__.py | 18 + .../models/__init__.py | 2 + .../models/fetchmail_server.py | 32 ++ .../models/helpdesk_ticket.py | 24 ++ .../security/mail_security.xml | 15 + .../views/fetchmail_server_view.xml | 26 ++ .../views/helpdesk_ticket_team_view.xml | 19 + helpdesk_ticket_custom_priority/README.rst | 17 + helpdesk_ticket_custom_priority/__init__.py | 3 + .../__manifest__.py | 19 + .../models/__init__.py | 3 + .../models/helpdesk_ticket.py | 15 + .../views/helpdesk_ticket_view.xml | 17 + 24 files changed, 929 insertions(+) create mode 100644 helpdesk_mgmt_email/__init__.py create mode 100644 helpdesk_mgmt_email/__manifest__.py create mode 100644 helpdesk_mgmt_email/data/automated_action.xml create mode 100644 helpdesk_mgmt_email/data/mail_template.xml create mode 100644 helpdesk_mgmt_email/i18n/nl.po create mode 100644 helpdesk_mgmt_email/models/__init__.py create mode 100644 helpdesk_mgmt_email/models/helpdesk_ticket.py create mode 100644 helpdesk_mgmt_email/models/helpdesk_ticket_team.py create mode 100644 helpdesk_mgmt_email/views/helpdesk_ticket_team_view.xml create mode 100644 helpdesk_mgmt_email/views/helpdesk_ticket_view.xml create mode 100644 helpdesk_mgmt_fetchmail_multicompany/__init__.py create mode 100644 helpdesk_mgmt_fetchmail_multicompany/__manifest__.py create mode 100644 helpdesk_mgmt_fetchmail_multicompany/models/__init__.py create mode 100644 helpdesk_mgmt_fetchmail_multicompany/models/fetchmail_server.py create mode 100644 helpdesk_mgmt_fetchmail_multicompany/models/helpdesk_ticket.py create mode 100644 helpdesk_mgmt_fetchmail_multicompany/security/mail_security.xml create mode 100644 helpdesk_mgmt_fetchmail_multicompany/views/fetchmail_server_view.xml create mode 100644 helpdesk_mgmt_fetchmail_multicompany/views/helpdesk_ticket_team_view.xml create mode 100644 helpdesk_ticket_custom_priority/README.rst create mode 100644 helpdesk_ticket_custom_priority/__init__.py create mode 100644 helpdesk_ticket_custom_priority/__manifest__.py create mode 100644 helpdesk_ticket_custom_priority/models/__init__.py create mode 100644 helpdesk_ticket_custom_priority/models/helpdesk_ticket.py create mode 100644 helpdesk_ticket_custom_priority/views/helpdesk_ticket_view.xml diff --git a/helpdesk_mgmt_email/__init__.py b/helpdesk_mgmt_email/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/helpdesk_mgmt_email/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/helpdesk_mgmt_email/__manifest__.py b/helpdesk_mgmt_email/__manifest__.py new file mode 100644 index 0000000..2260b67 --- /dev/null +++ b/helpdesk_mgmt_email/__manifest__.py @@ -0,0 +1,19 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Helpdesk Mail", + "summary": "Adds the option to send out helpdesk ticket updates to contacts by email.", + "version": "16.0.1.0.0", + "license": "AGPL-3", + "category": "After-Sales", + "author": "Onestein BV", + "website": "https://www.onestein.eu", + "depends": ["helpdesk_mgmt", "base_automation", "mail_layout_force"], + "data": [ + "data/mail_template.xml", + "data/automated_action.xml", + "views/helpdesk_ticket_team_view.xml", + "views/helpdesk_ticket_view.xml", + ], + "installable": True, +} diff --git a/helpdesk_mgmt_email/data/automated_action.xml b/helpdesk_mgmt_email/data/automated_action.xml new file mode 100644 index 0000000..d70767a --- /dev/null +++ b/helpdesk_mgmt_email/data/automated_action.xml @@ -0,0 +1,16 @@ + + + + Email on helpdesk ticket creation + + mail_post + on_create + comment + + + + + diff --git a/helpdesk_mgmt_email/data/mail_template.xml b/helpdesk_mgmt_email/data/mail_template.xml new file mode 100644 index 0000000..32554d2 --- /dev/null +++ b/helpdesk_mgmt_email/data/mail_template.xml @@ -0,0 +1,212 @@ + + + + Support Ticket Number + + + {{ object.team_id.email or object.company_id.partner_id.email or ''}} + {{not object.partner_id and object.partner_email or ''}} + {{object.partner_id.id}} + {{ object.team_id.email or object.company_id.partner_id.email or ''}} + {{ object.partner_id.lang or ctx.get("lang") or object.company_id.partner_id.lang or object.env.user.lang }} + Ticket {{object.number or 'n/a' }}: {{object.name or '' }} + +
Dear +
+
+

+ Thank you for your report. Your report has been registered under ticket and is being processed. +

+

If there are any questions or uncertainties, please let us know.

+ Kind regards, +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + Support + + + +
+ +   + +
+
+   +
+
T:   +
A:   + + + | + + + + +
W:   + +
+
+
+

+ This e-mail is intended for the addressee’s eyes only. If you are not the intended recipient, you are hereby kindly requested to inform the sender of this. In view of the electronic nature of this communication, is neither liable for the proper and complete transmission of the information contained therein nor for any delay in its receipt. For information about + + ,direct your browser to + +

+
+
+
+ + + Support + + + {{ object.team_id.email or object.company_id.partner_id.email or ''}} + {{not object.partner_id and object.partner_email or ''}} + {{object.partner_id.id}} + {{ object.team_id.email or object.company_id.partner_id.email or ''}} + {{ object.partner_id.lang or ctx.get("lang") or object.company_id.partner_id.lang or object.env.user.lang }} + Ticket {{object.number or 'n/a' }}: {{object.name or '' }} + +
Dear +
+
+ Kind regards, +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + Support + + + +
+ +   + +
+
+   +
+
T:   +
A:   + + + | + + + + +
W:   + +
+
+
+

+ This e-mail is intended for the addressee’s eyes only. If you are not the intended recipient, you are hereby kindly requested to inform the sender of this. In view of the electronic nature of this communication, is neither liable for the proper and complete transmission of the information contained therein nor for any delay in its receipt. For information about + + ,direct your browser to + +

+
+
+
+
diff --git a/helpdesk_mgmt_email/i18n/nl.po b/helpdesk_mgmt_email/i18n/nl.po new file mode 100644 index 0000000..29a9013 --- /dev/null +++ b/helpdesk_mgmt_email/i18n/nl.po @@ -0,0 +1,399 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * helpdesk_mgmt_email +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-03-14 07:50+0000\n" +"PO-Revision-Date: 2024-03-14 07:50+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: helpdesk_mgmt_email +#: model:mail.template,body_html:helpdesk_mgmt_email.helpdesk_ticket_draft_email_template +msgid "" +"
Dear \n" +"
\n" +"
\n" +" Kind regards,\n" +"
\n" +"
\n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +"
\n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" Support\n" +" \n" +" \n" +" \n" +"
\n" +" \n" +"  \n" +" \n" +"
\n" +"
\n" +"  \n" +"
\n" +"
T:  \n" +"
A:  \n" +" \n" +" \n" +" |\n" +" \n" +" \n" +" \n" +" \n" +"
W:  \n" +" \n" +"
\n" +"
\n" +"
\n" +"

\n" +" This e-mail is intended for the addressee’s eyes only. If you are not the intended recipient, you are hereby kindly requested to inform the sender of this. In view of the electronic nature of this communication, is neither liable for the proper and complete transmission of the information contained therein nor for any delay in its receipt. For information about \n" +" \n" +" ,direct your browser to \n" +" \n" +"

\n" +"
\n" +" " +msgstr "" +"
Beste \n" +"
\n" +"
\n" +" Met vriendelijke groet,\n" +"
\n" +"
\n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +"
\n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" Support\n" +" \n" +" \n" +" \n" +"
\n" +" \n" +"  \n" +" \n" +"
\n" +"
\n" +"  \n" +"
\n" +"
T:  \n" +"
A:  \n" +" \n" +" \n" +" |\n" +" \n" +" \n" +" \n" +" \n" +"
W:  \n" +" \n" +"
\n" +"
\n" +"
\n" +"

\n" +" Dit e-mailbericht is uitsluitend bestemd voor de geadresseerde. Als dit bericht niet voor u bestemd is, wordt u vriendelijk verzocht dit aan de afzender te melden. staat door de elektronische verzending van dit bericht niet in voor de juiste en volledige overbrenging van de inhoud, noch voor tijdige ontvangst daarvan. Voor informatie over \n" +" \n" +" ,raadpleegt u \n" +" \n" +"

\n" +"
\n" +" " + +#. module: helpdesk_mgmt_email +#: model:mail.template,body_html:helpdesk_mgmt_email.helpdesk_ticket_created_email_template +msgid "" +"
Dear \n" +"
\n" +"
\n" +"

\n" +" Thank you for your report. Your report has been registered under ticket and is being processed.\n" +"

\n" +"

If there are any questions or uncertainties, please let us know.

\n" +" Kind regards,\n" +"
\n" +"
\n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +"
\n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" Support\n" +" \n" +" \n" +" \n" +"
\n" +" \n" +"  \n" +" \n" +"
\n" +"
\n" +"  \n" +"
\n" +"
T:  \n" +"
A:  \n" +" \n" +" \n" +" |\n" +" \n" +" \n" +" \n" +" \n" +"
W:  \n" +" \n" +"
\n" +"
\n" +"
\n" +"

\n" +" This e-mail is intended for the addressee’s eyes only. If you are not the intended recipient, you are hereby kindly requested to inform the sender of this. In view of the electronic nature of this communication, is neither liable for the proper and complete transmission of the information contained therein nor for any delay in its receipt. For information about \n" +" \n" +" ,direct your browser to \n" +" \n" +"

\n" +"
\n" +" " +msgstr "" +"
Beste \n" +"
\n" +"
\n" +"

\n" +" Bedankt voor je melding. Je melding is geregistreerd onder ticket wordt in behandeling genomen.\n" +"

\n" +"

Als er vragen of onduidelijkheden zijn, laat het ons dan gerust weten.

\n" +" Met vriendelijke groet,\n" +"
\n" +"
\n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +"
\n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" Support\n" +" \n" +" \n" +" \n" +"
\n" +" \n" +"  \n" +" \n" +"
\n" +"
\n" +"  \n" +"
\n" +"
T:  \n" +"
A:  \n" +" \n" +" \n" +" |\n" +" \n" +" \n" +" \n" +" \n" +"
W:  \n" +" \n" +"
\n" +"
\n" +"
\n" +"

\n" +" Dit e-mailbericht is uitsluitend bestemd voor de geadresseerde. Als dit bericht niet voor u bestemd is, wordt u vriendelijk verzocht dit aan de afzender te melden. staat door de elektronische verzending van dit bericht niet in voor de juiste en volledige overbrenging van de inhoud, noch voor tijdige ontvangst daarvan. Voor informatie over \n" +" \n" +" ,raadpleegt u \n" +" \n" +"

\n" +"
\n" +" " + +#. module: helpdesk_mgmt_email +#. odoo-python +#: code:addons/helpdesk_mgmt_email/models/helpdesk_ticket.py:0 +#, python-format +msgid "Compose Email" +msgstr "Email opstellen" + +#. module: helpdesk_mgmt_email +#: model:ir.model.fields,field_description:helpdesk_mgmt_email.field_helpdesk_ticket_team__email +msgid "Email" +msgstr "" + +#. module: helpdesk_mgmt_email +#: model:ir.actions.server,name:helpdesk_mgmt_email.automated_action_on_ticket_creation_ir_actions_server +msgid "Email on helpdesk ticket creation" +msgstr "E-mail over het aanmaken van helpdesktickets" + +#. module: helpdesk_mgmt_email +#: model:ir.model,name:helpdesk_mgmt_email.model_helpdesk_ticket +msgid "Helpdesk Ticket" +msgstr "" + +#. module: helpdesk_mgmt_email +#: model:ir.model,name:helpdesk_mgmt_email.model_helpdesk_ticket_team +msgid "Helpdesk Ticket Team" +msgstr "" + +#. module: helpdesk_mgmt_email +#: model_terms:ir.ui.view,arch_db:helpdesk_mgmt_email.ticket_view_form +msgid "Send Email" +msgstr "E-mail verzenden" + +#. module: helpdesk_mgmt_email +#: model:mail.template,name:helpdesk_mgmt_email.helpdesk_ticket_draft_email_template +msgid "Support" +msgstr "Ondersteunings" + +#. module: helpdesk_mgmt_email +#: model:mail.template,name:helpdesk_mgmt_email.helpdesk_ticket_created_email_template +msgid "Support Ticket Number" +msgstr "Ondersteunings Ticket Nummer" + +#. module: helpdesk_mgmt_email +#: model:ir.model.fields,help:helpdesk_mgmt_email.field_helpdesk_ticket_team__email +msgid "This would be used when sending out emails to contacts" +msgstr "Dit zou worden gebruikt bij het verzenden van e-mails naar contacten" + +#. module: helpdesk_mgmt_email +#: model:mail.template,subject:helpdesk_mgmt_email.helpdesk_ticket_created_email_template +#: model:mail.template,subject:helpdesk_mgmt_email.helpdesk_ticket_draft_email_template +msgid "Ticket {{object.number or 'n/a' }}: {{object.name or '' }}" +msgstr "" \ No newline at end of file diff --git a/helpdesk_mgmt_email/models/__init__.py b/helpdesk_mgmt_email/models/__init__.py new file mode 100644 index 0000000..c005bbd --- /dev/null +++ b/helpdesk_mgmt_email/models/__init__.py @@ -0,0 +1,2 @@ +from . import helpdesk_ticket +from . import helpdesk_ticket_team diff --git a/helpdesk_mgmt_email/models/helpdesk_ticket.py b/helpdesk_mgmt_email/models/helpdesk_ticket.py new file mode 100644 index 0000000..ff9813c --- /dev/null +++ b/helpdesk_mgmt_email/models/helpdesk_ticket.py @@ -0,0 +1,29 @@ +from odoo import _, models + + +class HelpdeskTicket(models.Model): + _inherit = "helpdesk.ticket" + + def action_ticket_send(self): + self.ensure_one() + template = self.env.ref( + "helpdesk_mgmt_email.helpdesk_ticket_created_email_template", False + ) + compose_form = self.env.ref("mail.email_compose_message_wizard_form") + ctx = dict( + default_model="helpdesk.ticket", + default_res_id=self.id, + default_use_template=bool(template), + default_template_id=template and template.id or False, + default_composition_mode="comment", + ) + return { + "name": _("Compose Email"), + "type": "ir.actions.act_window", + "view_mode": "form", + "res_model": "mail.compose.message", + "views": [(compose_form.id, "form")], + "view_id": compose_form.id, + "target": "new", + "context": ctx, + } diff --git a/helpdesk_mgmt_email/models/helpdesk_ticket_team.py b/helpdesk_mgmt_email/models/helpdesk_ticket_team.py new file mode 100644 index 0000000..aac98e5 --- /dev/null +++ b/helpdesk_mgmt_email/models/helpdesk_ticket_team.py @@ -0,0 +1,9 @@ +from odoo import fields, models + + +class HelpdeskTeam(models.Model): + _inherit = "helpdesk.ticket.team" + + email = fields.Char( + "Team Email", help="This would be used when sending out emails to contacts" + ) diff --git a/helpdesk_mgmt_email/views/helpdesk_ticket_team_view.xml b/helpdesk_mgmt_email/views/helpdesk_ticket_team_view.xml new file mode 100644 index 0000000..b85bd73 --- /dev/null +++ b/helpdesk_mgmt_email/views/helpdesk_ticket_team_view.xml @@ -0,0 +1,13 @@ + + + + view.helpdesk_team.form + helpdesk.ticket.team + + + + + + + + diff --git a/helpdesk_mgmt_email/views/helpdesk_ticket_view.xml b/helpdesk_mgmt_email/views/helpdesk_ticket_view.xml new file mode 100644 index 0000000..6f19cba --- /dev/null +++ b/helpdesk_mgmt_email/views/helpdesk_ticket_view.xml @@ -0,0 +1,18 @@ + + + + view.helpdesk.ticket.form + helpdesk.ticket + + + +