From c1865a421b0551ac052487e99a5b8c464d8345cb Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Fri, 31 May 2024 14:04:11 +0200 Subject: [PATCH] [FIX] bi_sql_editor : prevent to raise an error when creating a cron for a materialized view, if it is the last of the month. --- bi_sql_editor/models/bi_sql_view.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bi_sql_editor/models/bi_sql_view.py b/bi_sql_editor/models/bi_sql_view.py index b4f9be6a4f..59cb4e88ee 100644 --- a/bi_sql_editor/models/bi_sql_view.py +++ b/bi_sql_editor/models/bi_sql_view.py @@ -3,7 +3,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). import logging -from datetime import datetime +from datetime import datetime, timedelta from psycopg2 import ProgrammingError from odoo import _, api, fields, models, SUPERUSER_ID @@ -402,7 +402,7 @@ def _prepare_cron(self): 'numbercall': -1, 'interval_number': 1, 'interval_type': 'days', - 'nextcall': datetime(now.year, now.month, now.day+1), + "nextcall": now + timedelta(days=1), 'active': True, }