From 59bb6d61bddd4bb2dd28234a42dee2368d8b6eb5 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Wed, 4 Jul 2018 16:26:01 +0200 Subject: [PATCH] [FIX] prepare of cron --- bi_sql_editor/models/bi_sql_view.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bi_sql_editor/models/bi_sql_view.py b/bi_sql_editor/models/bi_sql_view.py index 37e4b235..395ebdbf 100644 --- a/bi_sql_editor/models/bi_sql_view.py +++ b/bi_sql_editor/models/bi_sql_view.py @@ -222,6 +222,11 @@ class BiSQLView(models.Model): def button_refresh_materialized_view(self): self._refresh_materialized_view() + @api.model + def cron_refresh_materialized_view(self, ids): + items = self.browse(ids) + items._refresh_materialized_view() + @api.multi def button_open_view(self): return { @@ -271,7 +276,7 @@ class BiSQLView(models.Model): 'name': _('Refresh Materialized View %s') % (self.view_name), 'user_id': SUPERUSER_ID, 'model': 'bi.sql.view', - 'function': 'button_refresh_materialized_view', + 'function': 'cron_refresh_materialized_view', 'args': repr(([self.id],)) }