From a4687c6e42a7b0ec6b8d98dc2af7fe2d1c3272d0 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Thu, 26 May 2016 08:29:39 +0200 Subject: [PATCH] [FIX] gamification: bad backport to 8.0 UserError was defined in version 9, not 8 --- addons/gamification/models/goal.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/gamification/models/goal.py b/addons/gamification/models/goal.py index a63431a83c4..969d4321bab 100644 --- a/addons/gamification/models/goal.py +++ b/addons/gamification/models/goal.py @@ -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)