From fe8f74d5d0ad1acbeafe59dafe4d0650e6e87f29 Mon Sep 17 00:00:00 2001 From: Denis Leemann Date: Tue, 14 Nov 2023 11:39:47 +0100 Subject: [PATCH] [FIX][bi_sql_editor] unlink bi_sql_view without cron It wasn't possible to unlink him. A fix has been done in 16.0: https://github.com/OCA/reporting-engine/pull/770 But letting the ORM handling him doesn't require the line of code --- bi_sql_editor/models/bi_sql_view.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bi_sql_editor/models/bi_sql_view.py b/bi_sql_editor/models/bi_sql_view.py index 6193b450d4..284e923232 100644 --- a/bi_sql_editor/models/bi_sql_view.py +++ b/bi_sql_editor/models/bi_sql_view.py @@ -158,6 +158,7 @@ class BiSQLView(models.Model): comodel_name="ir.cron", readonly=True, help="Cron Task that will refresh the materialized view", + ondelete="cascade", ) rule_id = fields.Many2one(string="Odoo Rule", comodel_name="ir.rule", readonly=True) @@ -259,7 +260,6 @@ def unlink(self): "If you want to delete them, first set them to draft." ) ) - self.cron_id.unlink() return super(BiSQLView, self).unlink() def copy(self, default=None):