From a4335ab1e55bb2270bb4d39dc68ac1d4a93d35bf Mon Sep 17 00:00:00 2001 From: std-odoo Date: Thu, 21 Dec 2023 09:14:55 +0100 Subject: [PATCH] [IMP] microsoft_outlook: remove the constrain on the from_filter Purpose ======= We added a constraint to make the from filter match the login for the Outlook mail servers, which makes sense most of the time. But in the Outlook settings, we can allow to send email from a different email address, and so that constraint blocks that use case. Task-3645954 closes odoo/odoo#147246 Signed-off-by: Thibault Delavallee (tde) --- addons/microsoft_outlook/models/ir_mail_server.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/addons/microsoft_outlook/models/ir_mail_server.py b/addons/microsoft_outlook/models/ir_mail_server.py index 14515b8abc6..1fa457a28ed 100644 --- a/addons/microsoft_outlook/models/ir_mail_server.py +++ b/addons/microsoft_outlook/models/ir_mail_server.py @@ -33,7 +33,7 @@ class IrMailServer(models.Model): 'To extend its use, you should set a "mail.default.from" system parameter.') super(IrMailServer, self - outlook_servers)._compute_smtp_authentication_info() - @api.constrains('smtp_authentication', 'smtp_pass', 'smtp_encryption', 'from_filter', 'smtp_user') + @api.constrains('smtp_authentication', 'smtp_pass', 'smtp_encryption', 'smtp_user') def _check_use_microsoft_outlook_service(self): outlook_servers = self.filtered(lambda server: server.smtp_authentication == 'outlook') for server in outlook_servers: @@ -47,11 +47,6 @@ class IrMailServer(models.Model): 'Incorrect Connection Security for Outlook mail server %r. ' 'Please set it to "TLS (STARTTLS)".', server.name)) - if server.from_filter != server.smtp_user: - raise UserError(_( - 'This server %r can only be used for your personal email address. ' - 'Please fill the "from_filter" field with %r.', server.name, server.smtp_user)) - if not server.smtp_user: raise UserError(_( 'Please fill the "Username" field with your Outlook/Office365 username (your email address). '