From db466a1d6ac8a9acbf0168c91719e0273a676e3f Mon Sep 17 00:00:00 2001 From: Hansa Rathod Date: Tue, 10 Jul 2018 15:47:25 +0530 Subject: [PATCH] [IMP]: Added Upstream patch for HR --- addons/hr/models/hr.py | 2 +- addons/hr/models/mail_alias.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/hr/models/hr.py b/addons/hr/models/hr.py index dc5b61b9..6098f43b 100644 --- a/addons/hr/models/hr.py +++ b/addons/hr/models/hr.py @@ -5,7 +5,7 @@ import logging from flectra import api, fields, models from flectra import tools, _ -from flectra.exceptions import ValidationError +from flectra.exceptions import ValidationError, AccessError from flectra.modules.module import get_module_resource _logger = logging.getLogger(__name__) diff --git a/addons/hr/models/mail_alias.py b/addons/hr/models/mail_alias.py index 66c4a1eb..43662e27 100644 --- a/addons/hr/models/mail_alias.py +++ b/addons/hr/models/mail_alias.py @@ -14,7 +14,7 @@ class MailAlias(models.AbstractModel): _inherit = 'mail.alias.mixin' def _alias_check_contact_on_record(self, record, message, message_dict, alias): - if alias.alias_contact == 'employees' and record.ids: + if alias.alias_contact == 'employees': email_from = tools.decode_message_header(message, 'From') email_address = tools.email_split(email_from)[0] employee = self.env['hr.employee'].search([('work_email', 'ilike', email_address)], limit=1)