[INP] gamification: skip check for not required fields

Could get a definition with a model only
This commit is contained in:
Martin Trigaux 2016-05-26 08:33:20 +02:00
parent a4687c6e42
commit 37bbe87d57
No known key found for this signature in database
GPG Key ID: 7B0E288E7C0F83A7
1 changed files with 3 additions and 0 deletions

View File

@ -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: