[16.0][FIX][bi_sql_editor] unlink bi_sql_view without cron

Forward port of https://github.com/OCA/reporting-engine/pull/811
This commit is contained in:
Denis Leemann
2023-11-14 16:37:07 +01:00
committed by thien
parent 4e2754d55c
commit d79eee9eb2

View File

@@ -156,6 +156,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)
@@ -263,8 +264,6 @@ class BiSQLView(models.Model):
"If you want to delete them, first set them to draft."
)
)
if self.cron_id:
self.cron_id.unlink()
return super().unlink()
def copy(self, default=None):