Skip to content
Snippets Groups Projects
Commit 1c1b440a authored by Romeo Fragomeli's avatar Romeo Fragomeli Committed by fw-bot
Browse files

[FIX] base: a traceback appear when we test SMTP connection in technical settings


Before this commit, in base we use bus to notify the user but bus module
is not always installed and so we can't call it.

After this commit, now we use a client action to notify the success test.

Steps to reproduce:
* install a Odoo with no apps
* go in debug mode
* go to "Outgoing Mail Servers" technical settings
* create a valid SMTP record
* click on "Test Connection" button (BUG)

closes odoo/odoo#38709

X-original-commit: ea411374
Signed-off-by: default avatarAaron Bohy (aab) <aab@odoo.com>
parent 547d2d87
No related branches found
No related tags found
No related merge requests found
......@@ -126,9 +126,15 @@ class IrMailServer(models.Model):
title = _("Connection Test Succeeded!")
message = _("Everything seems properly set up!")
self.env['bus.bus'].sendone(
(self._cr.dbname, 'res.partner', self.env.user.partner_id.id),
{'type': 'simple_notification', 'title': title, 'message': message, 'sticky': False, 'warning': False})
return {
'type': 'ir.actions.client',
'tag': 'display_notification',
'params': {
'title': title,
'message': message,
'sticky': False,
}
}
def connect(self, host=None, port=None, user=None, password=None, encryption=None,
smtp_debug=False, mail_server_id=None):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment