From 37bbe87d5792c879130e5f1e491f743cbc50dc1e Mon Sep 17 00:00:00 2001
From: Martin Trigaux <mat@odoo.com>
Date: Thu, 26 May 2016 08:33:20 +0200
Subject: [PATCH] [INP] gamification: skip check for not required fields

Could get a definition with a model only
---
 addons/gamification/models/goal.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/addons/gamification/models/goal.py b/addons/gamification/models/goal.py
index 969d4321bab0..42fd073b58e0 100644
--- a/addons/gamification/models/goal.py
+++ b/addons/gamification/models/goal.py
@@ -152,6 +152,9 @@ class gamification_goal_definition(osv.Model):
         """ make sure the selected field and model are usable"""
         for definition in self.browse(cr, uid, ids, context=context):
             try:
+                if not definition.model_id or not definition.field_id:
+                    continue
+
                 model = self.pool[definition.model_id.model]
                 field = model._fields[definition.field_id.name]
                 if not field.store:
-- 
GitLab