From f3f2801a559ba8e145866650e0fc37c4c530a1c6 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Mon, 7 Sep 2020 10:27:03 +0200 Subject: [PATCH] [FIX] delete sql view by order desc, to avoid errors if one sql view depends on another sql view --- bi_sql_editor/hooks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bi_sql_editor/hooks.py b/bi_sql_editor/hooks.py index ec2ecb6a8..106066bcd 100644 --- a/bi_sql_editor/hooks.py +++ b/bi_sql_editor/hooks.py @@ -6,6 +6,6 @@ from odoo.api import Environment def uninstall_hook(cr, registry): env = Environment(cr, SUPERUSER_ID, {}) - recs = env['bi.sql.view'].search([]) + recs = env['bi.sql.view'].search([], order="id desc") for rec in recs: rec.button_set_draft()