From 54483293cc4e53013cf6c15731aa7de1b60fa138 Mon Sep 17 00:00:00 2001 From: Thomas Fossoul Date: Tue, 14 Dec 2021 09:30:53 +0100 Subject: [PATCH 1/2] [IMP] bi_sql_editor : conserve cron settings, when setting materialized view to draft ; Set correct default values for cron and enable it --- bi_sql_editor/models/bi_sql_view.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/bi_sql_editor/models/bi_sql_view.py b/bi_sql_editor/models/bi_sql_view.py index 6c5627f76..588fb36eb 100644 --- a/bi_sql_editor/models/bi_sql_view.py +++ b/bi_sql_editor/models/bi_sql_view.py @@ -279,7 +279,7 @@ class BiSQLView(models.Model): # Overload Section def write(self, vals): - res = super(BiSQLView, self).write(vals) + res = super().write(vals) if vals.get("sequence", False): for rec in self.filtered(lambda x: x.menu_id): rec.menu_id.sequence = rec.sequence @@ -293,8 +293,9 @@ class BiSQLView(models.Model): "If you want to delete them, first set them to draft." ) ) - self.cron_id.unlink() - return super(BiSQLView, self).unlink() + if self.mapped("cron_id"): + self.mapped("cron_id").unlink() + return super().unlink() def copy(self, default=None): self.ensure_one() @@ -305,7 +306,7 @@ class BiSQLView(models.Model): "technical_name": "%s_copy" % self.technical_name, } ) - return super(BiSQLView, self).copy(default=default) + return super().copy(default=default) # Action Section def button_create_sql_view_and_model(self): @@ -658,7 +659,7 @@ class BiSQLView(models.Model): the database structure is done, to know fields type.""" self.ensure_one() sql_view_field_obj = self.env["bi.sql.view.field"] - columns = super(BiSQLView, self)._check_execution() + columns = super()._check_execution() field_ids = [] for column in columns: existing_field = self.bi_sql_view_field_ids.filtered( From fb2b0fe7b8adaa9d9ed6e421144e43e1f614bd4f Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Mon, 3 Jan 2022 11:30:52 +0100 Subject: [PATCH 2/2] [ADD] legalsylvain as maintainers of bi_sql_editor --- bi_sql_editor/__manifest__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/bi_sql_editor/__manifest__.py b/bi_sql_editor/__manifest__.py index 3a909ba72..0967aa79a 100644 --- a/bi_sql_editor/__manifest__.py +++ b/bi_sql_editor/__manifest__.py @@ -9,6 +9,7 @@ "license": "AGPL-3", "category": "Reporting", "author": "GRAP,Odoo Community Association (OCA)", + "maintainers": ["legalsylvain"], "website": "https://github.com/OCA/reporting-engine", "depends": ["base", "sql_request_abstract"], "data": [