From d75755dab503de1021d3aeeeba3c6fbbe5f6cfd1 Mon Sep 17 00:00:00 2001 From: Nicolas Mac Rouillon Date: Tue, 13 Dec 2016 16:45:28 -0300 Subject: [PATCH] IMP implementation of iteration --- web_dashboard_tile/models/tile_tile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web_dashboard_tile/models/tile_tile.py b/web_dashboard_tile/models/tile_tile.py index 38ce5c66..0ee69ef6 100644 --- a/web_dashboard_tile/models/tile_tile.py +++ b/web_dashboard_tile/models/tile_tile.py @@ -144,12 +144,12 @@ class TileTile(models.Model): @api.multi def _compute_data(self): + eval_context = self._get_eval_context() for rec in self: if not rec.active: return - model = self.env[rec.model_id.model] - eval_context = self._get_eval_context() domain = rec.domain or '[]' + model = rec.env[rec.model_id.model] try: count = model.search_count(eval(domain, eval_context)) except Exception as e: