From 0d0dd192e476a1891134b87787672c5f5116bc1d Mon Sep 17 00:00:00 2001 From: nicomacr Date: Mon, 14 Aug 2017 10:10:33 -0300 Subject: [PATCH] [9.0] FIX bi_sql_editor --- bi_sql_editor/models/bi_sql_view.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bi_sql_editor/models/bi_sql_view.py b/bi_sql_editor/models/bi_sql_view.py index dffa9b57..bafa3d3e 100644 --- a/bi_sql_editor/models/bi_sql_view.py +++ b/bi_sql_editor/models/bi_sql_view.py @@ -215,7 +215,6 @@ class BiSQLView(models.Model): sql_view.search_view_id.unlink() sql_view.action_id.unlink() sql_view.menu_id.unlink() - sql_view.rule_id.unlink() if sql_view.cron_id: sql_view.cron_id.unlink() sql_view.write({'state': 'draft', 'has_group_changed': False}) @@ -465,6 +464,8 @@ class BiSQLView(models.Model): @api.multi def _drop_model_and_fields(self): for sql_view in self: + if sql_view.rule_id: + sql_view.rule_id.unlink() if sql_view.model_id: sql_view.model_id.unlink()