From 3751379f1e9a4c215fb6eb898b4ccc67659b9ace Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Tue, 10 May 2022 21:51:50 +0700 Subject: initial commit 2 --- addons/hr/models/mail_alias.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 addons/hr/models/mail_alias.py (limited to 'addons/hr/models/mail_alias.py') diff --git a/addons/hr/models/mail_alias.py b/addons/hr/models/mail_alias.py new file mode 100644 index 00000000..69042cfb --- /dev/null +++ b/addons/hr/models/mail_alias.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo import fields, models, _ + + +class Alias(models.Model): + _inherit = 'mail.alias' + + alias_contact = fields.Selection(selection_add=[ + ('employees', 'Authenticated Employees'), + ], ondelete={'employees': 'cascade'}) + + def _get_alias_bounced_body_fallback(self, message_dict): + if self.alias_contact == 'employees': + return _("""Hi,
+Your document has not been created because your email address is not recognized.
+Please send emails with the email address recorded on your employee information, or contact your HR manager.""") + return super(Alias, self)._get_alias_bounced_body_fallback(message_dict) -- cgit v1.2.3