[IMP] base: improve some error messages/translations (modified patch from P. Christeas)
bzr revid: odo@openerp.com-20101020171739-2uc9a6fechrl5iaj
This commit is contained in:
parent
69ea053093
commit
973af690b5
|
@ -209,7 +209,7 @@ class ir_model_fields(osv.osv):
|
|||
raise except_orm(_('Error'), _("Custom fields must have a name that starts with 'x_' !"))
|
||||
|
||||
if vals.get('relation',False) and not self.pool.get('ir.model').search(cr, user, [('model','=',vals['relation'])]):
|
||||
raise except_orm(_('Error'), _("Model %s Does not Exist !" % vals['relation']))
|
||||
raise except_orm(_('Error'), _("Model %s does not exist!") % vals['relation'])
|
||||
|
||||
if self.pool.get(vals['model']):
|
||||
self.pool.get(vals['model']).__init__(self.pool, cr)
|
||||
|
|
|
@ -232,7 +232,7 @@ class module(osv.osv):
|
|||
raise Exception('Unable to find %r in path' % (binary,))
|
||||
|
||||
|
||||
def state_update(self, cr, uid, ids, newstate, states_to_update, context={}, level=100):
|
||||
def state_update(self, cr, uid, ids, newstate, states_to_update, context=None, level=100):
|
||||
if level<1:
|
||||
raise orm.except_orm(_('Error'), _('Recursion error in modules dependencies !'))
|
||||
demo = False
|
||||
|
@ -240,7 +240,7 @@ class module(osv.osv):
|
|||
mdemo = False
|
||||
for dep in module.dependencies_id:
|
||||
if dep.state == 'unknown':
|
||||
raise orm.except_orm(_('Error'), _("You try to install the module '%s' that depends on the module:'%s'.\nBut this module is not available in your system.") % (module.name, dep.name,))
|
||||
raise orm.except_orm(_('Error'), _("You try to install module '%s' that depends on module '%s'.\nBut the latter module is not available in your system.") % (module.name, dep.name,))
|
||||
ids2 = self.search(cr, uid, [('name','=',dep.name)])
|
||||
if dep.state != newstate:
|
||||
mdemo = self.state_update(cr, uid, ids2, newstate, states_to_update, context, level-1,) or mdemo
|
||||
|
@ -252,7 +252,13 @@ class module(osv.osv):
|
|||
try:
|
||||
self._check_external_dependencies(terp)
|
||||
except Exception, e:
|
||||
raise orm.except_orm(_('Error'), _('Unable %s the module "%s" because an external dependencie is not met: %s' % (newstate, module.name, e.args[0])))
|
||||
if newstate == 'to install':
|
||||
msg = _('Unable to install module "%s" because an external dependency is not met: %s')
|
||||
elif newstate == 'to upgrade':
|
||||
msg = _('Unable to upgrade module "%s" because an external dependency is not met: %s')
|
||||
else:
|
||||
msg = _('Unable to process module "%s" because an external dependency is not met: %s')
|
||||
raise orm.except_orm(_('Error'), msg % (module.name, e.args[0]))
|
||||
if not module.dependencies_id:
|
||||
mdemo = module.demo
|
||||
if module.state in states_to_update:
|
||||
|
|
|
@ -99,8 +99,7 @@ class res_config_configurable(osv.osv_memory):
|
|||
if not previous_todo:
|
||||
raise LookupError(_("Couldn't find previous ir.actions.todo"))
|
||||
if not state:
|
||||
raise ValueError(_("Can't set an ir.actions.todo's state to "
|
||||
"nothingness"))
|
||||
raise ValueError(_("Can't set an ir.actions.todo's state to an empty value."))
|
||||
previous_todo.write({'state':state})
|
||||
|
||||
def _next(self, cr, uid, context=None):
|
||||
|
|
Loading…
Reference in New Issue