New small module to have only one ticket created per email received.
This commit is contained in:
parent
ac9fb2b141
commit
c7a11c8a08
4 changed files with 50 additions and 0 deletions
1
bemade_helpdesk_one_ticket_per_email/__init__.py
Normal file
1
bemade_helpdesk_one_ticket_per_email/__init__.py
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
from . import models
|
||||||
31
bemade_helpdesk_one_ticket_per_email/__manifest__.py
Normal file
31
bemade_helpdesk_one_ticket_per_email/__manifest__.py
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
#
|
||||||
|
# Bemade Inc.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2023-June Bemade Inc. (<https://www.bemade.org>).
|
||||||
|
# Author: Marc Durepos (Contact : mdurepos@durpro.com)
|
||||||
|
#
|
||||||
|
# This program is under the terms of the Odoo Proprietary License v1.0 (OPL-1)
|
||||||
|
# It is forbidden to publish, distribute, sublicense, or sell copies of the Software
|
||||||
|
# or modified copies of the Software.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||||
|
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
|
# DEALINGS IN THE SOFTWARE.
|
||||||
|
#
|
||||||
|
{
|
||||||
|
'name': 'Helpdesk One Ticket Per Email',
|
||||||
|
'version': '15.0.1.0.0',
|
||||||
|
'summary': 'Restrict ticket creation to a single ticket per email received.',
|
||||||
|
'category': 'Helpdesk',
|
||||||
|
'author': 'Bemade Inc.',
|
||||||
|
'website': 'http://www.bemade.org',
|
||||||
|
'license': 'OPL-1',
|
||||||
|
'depends': ['helpdesk'],
|
||||||
|
'data': [],
|
||||||
|
'installable': True,
|
||||||
|
'auto_install': False
|
||||||
|
}
|
||||||
1
bemade_helpdesk_one_ticket_per_email/models/__init__.py
Normal file
1
bemade_helpdesk_one_ticket_per_email/models/__init__.py
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
from . import mail_thread
|
||||||
17
bemade_helpdesk_one_ticket_per_email/models/mail_thread.py
Normal file
17
bemade_helpdesk_one_ticket_per_email/models/mail_thread.py
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
from odoo import models, fields, api, _
|
||||||
|
|
||||||
|
|
||||||
|
class MailThread(models.AbstractModel):
|
||||||
|
_inherit = 'mail.thread'
|
||||||
|
|
||||||
|
@api.model
|
||||||
|
def message_route(self, message, message_dict, model=None, thread_id=None, custom_values=None):
|
||||||
|
res = super().message_route(message, message_dict, model, thread_id, custom_values)
|
||||||
|
main_route = None
|
||||||
|
for tuple in res:
|
||||||
|
if tuple[0] in ('helpdesk.team', 'helpdesk.ticket'):
|
||||||
|
if not main_route:
|
||||||
|
main_route = tuple
|
||||||
|
else:
|
||||||
|
res.remove(tuple)
|
||||||
|
return res
|
||||||
Loading…
Reference in a new issue