[IMP] Improved code
bzr revid: ggh@tinyerp.com-20130429105849-2peih2y8kknt65tu
This commit is contained in:
parent
dd7614e716
commit
058c816a8e
|
@ -213,14 +213,14 @@ class ir_mail_server(osv.osv):
|
|||
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))
|
||||
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!"))
|
||||
raise osv.except_osv(_("Connection Test Succeeded!"), _("Everything seems properly set up!"))
|
||||
|
||||
def connect(self, host, port, user=None, password=None, encryption=False, smtp_debug=False):
|
||||
"""Returns a new SMTP connection to the give SMTP server, authenticated
|
||||
|
|
|
@ -82,7 +82,7 @@ class ir_model(osv.osv):
|
|||
return []
|
||||
__, operator, value = domain[0]
|
||||
if operator not in ['=', '!=']:
|
||||
raise osv.except_osv(_('Invalid search criterions'), _('The osv_memory field can only be compared with = and != operator.'))
|
||||
raise osv.except_osv(_("Invalid Search Criteria"), _('The osv_memory field can only be compared with = and != operator.'))
|
||||
value = bool(value) if operator == '=' else not bool(value)
|
||||
all_model_ids = self.search(cr, uid, [], context=context)
|
||||
is_osv_mem = self._is_osv_memory(cr, uid, all_model_ids, 'osv_memory', arg=None, context=context)
|
||||
|
|
|
@ -94,7 +94,7 @@ class wkf_activity(osv.osv):
|
|||
def unlink(self, cr, uid, ids, context=None):
|
||||
if context is None: context = {}
|
||||
if not context.get('_force_unlink') and self.pool.get('workflow.workitem').search(cr, uid, [('act_id', 'in', ids)]):
|
||||
raise osv.except_osv(_('Operation forbidden'),
|
||||
raise osv.except_osv(_('Operation Forbidden'),
|
||||
_('Please make sure no workitems refer to an activity before deleting it!'))
|
||||
super(wkf_activity, self).unlink(cr, uid, ids, context=context)
|
||||
|
||||
|
|
Loading…
Reference in New Issue