Skip to content
Snippets Groups Projects
Commit a25358ea authored by Thibault Delavallée's avatar Thibault Delavallée
Browse files

[REM] hr: remove unimported file

Leftover of 78ac6de5 code about mail gateway was moved to
mail_alias.py but mail_thread.py file was not removed.
parent 20d80250
Branches
Tags
No related merge requests found
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, tools
from odoo.tools import email_split
class MailAlias(models.AbstractModel):
_inherit = 'mail.alias.mixin'
def _alias_check_contact(self, message, message_dict, alias):
if alias.alias_contact == 'employees' and self.ids:
email_from = tools.decode_message_header(message, 'From')
email_address = email_split(email_from)[0]
employee = self.env['hr.employee'].search([('work_email', 'ilike', email_address)], limit=1)
if not employee:
employee = self.env['hr.employee'].search([('user_id.email', 'ilike', email_address)], limit=1)
if not employee:
return {
'error_message': 'restricted to employees',
'error_template': self.env.ref('hr.mail_template_data_unknown_employee_email_address').body_html,
}
return True
return super(MailAlias, self)._alias_check_contact(message, message_dict, alias)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment