[FIX] gamification: bad backport to 8.0

UserError was defined in version 9, not 8
This commit is contained in:
Martin Trigaux 2016-05-26 08:29:39 +02:00
parent 9772bbef07
commit a4687c6e42
No known key found for this signature in database
GPG Key ID: 7B0E288E7C0F83A7
1 changed files with 4 additions and 2 deletions

View File

@ -155,9 +155,11 @@ class gamification_goal_definition(osv.Model):
model = self.pool[definition.model_id.model]
field = model._fields[definition.field_id.name]
if not field.store:
raise UserError(_("The model configuration for the definition %s seems incorrect, please check it.\n\n%s not stored") % (definition.name, definition.field_id.name))
raise osv.except_osv(_('Error!'),
_("The model configuration for the definition %s seems incorrect, please check it.\n\n%s not stored") % (definition.name, definition.field_id.name))
except KeyError, e:
raise UserError(_("The model configuration for the definition %s seems incorrect, please check it.\n\n%s not found") % (definition.name, e.message))
raise osv.except_osv(_('Error!'),
_("The model configuration for the definition %s seems incorrect, please check it.\n\n%s not found") % (definition.name, e.message))
def create(self, cr, uid, vals, context=None):
res_id = super(gamification_goal_definition, self).create(cr, uid, vals, context=context)