[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) <tde@openerp.com>
This commit is contained in:
std-odoo
2024-01-08 12:57:27 +00:00
parent d416afca3d
commit a4335ab1e5
@@ -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). '