diff options
| author | dut-odoo <dut@odoo.com> | 2016-08-09 15:10:47 +0530 |
|---|---|---|
| committer | Simon Lejeune <sle@openerp.com> | 2016-08-18 21:31:48 +0200 |
| commit | 8972bbd22607cbf57d27d9128c39a59e31a6ea53 (patch) | |
| tree | 737efea4b9bec64400cb80604e9ac8b56fb983a2 | |
| parent | 8c91d690f00d209450fba94be8a0a2116d8043c1 (diff) | |
[FIX] gamification: goal definition: traceback when changing model
* self.model_id is already a recordset, no need to re-browse it
* id are expected in domain, not recordset
oversight from rev 0c649644db0a941353a1db334f17f972ff871191
| -rw-r--r-- | addons/gamification/models/goal.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/addons/gamification/models/goal.py b/addons/gamification/models/goal.py index 74b187f153d..d9ebb699cd0 100644 --- a/addons/gamification/models/goal.py +++ b/addons/gamification/models/goal.py @@ -129,11 +129,10 @@ class GoalDefinition(models.Model): """Force domain for the `field_id` and `field_date_id` fields""" if not self.model_id: return {'domain': {'field_id': expression.FALSE_DOMAIN, 'field_date_id': expression.FALSE_DOMAIN}} - model = self.env['ir.model'].browse(self.model_id) model_fields_domain = [ ('store', '=', True), - '|', ('model_id', '=', self.model_id), - ('model_id', 'in', model.inherited_model_ids.ids)] + '|', ('model_id', '=', self.model_id.id), + ('model_id', 'in', self.model_id.inherited_model_ids.ids)] model_date_fields_domain = expression.AND([[('ttype', 'in', ('date', 'datetime'))], model_fields_domain]) return {'domain': {'field_id': model_fields_domain, 'field_date_id': model_date_fields_domain}} |
