Odoo上的外发邮件服务器出现问题

时间:2015-01-20 20:55:59

标签: python json odoo

我在Ubuntu 14.04上安装Odoo时遇到了问题。

当我尝试在Odoo上获取邮件时看起来一切都很好,但当我拖尾日志文件时,我会发现很多错误:

    015-01-20 20:41:42,192 2597 ERROR COMPANYNAME openerp.http: Exception during JSON request handling.
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 524, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 545, in dispatch
    result = self._call_function(**self.params)
  File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 301, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/openerp/service/model.py", line 113, in wrapper
    return f(dbname, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 298, in checked_call
    return self.endpoint(*a, **kw)
  File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 761, in __call__
    return self.method(*args, **kw)
  File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 394, in response_wrap
    response = f(*args, **kw)
  File "/usr/lib/python2.7/dist-packages/openerp/addons/web/controllers/main.py", line 953, in call_button
    action = self._call_kw(model, method, args, {})
  File "/usr/lib/python2.7/dist-packages/openerp/addons/web/controllers/main.py", line 941, in _call_kw
    return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 237, in wrapper    return old_api(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_mail_server.py", line 215, in test_smtp_connection
    raise osv.except_osv(_("Connection Test Succeeded!"), _("Everything seems properly set up!"))
except_orm: (u'Verbindungstest erfolgreich!', u'Alles scheint richtig konfiguriert zu sein.')

任何帮助都将不胜感激。

1 个答案:

答案 0 :(得分:1)

这是误导。 Odoo开发者通过使用例外向您展示信息窗口而被欺骗。

def test_smtp_connection(self, cr, uid, ids, context=None):
    for smtp_server in self.browse(cr, uid, ids, context=context):
        smtp = False
        try:
            smtp = self.connect(smtp_server.smtp_host, smtp_server.smtp_port, user=smtp_server.smtp_user,
                                password=smtp_server.smtp_pass, encryption=smtp_server.smtp_encryption,
                                smtp_debug=smtp_server.smtp_debug)
        except Exception, e:
            raise osv.except_osv(_("Connection Test Failed!"), _("Here is what we got instead:\n %s") % tools.ustr(e))
        finally:
            try:
                if smtp: smtp.quit()
            except Exception:
                # ignored, just a consequence of the previous exception
                pass
    raise osv.except_osv(_("Connection Test Succeeded!"), _("Everything seems properly set up!"))