diff --git a/website_cookiebot/__manifest__.py b/website_cookiebot/__manifest__.py index a14c7a2474..290f3049d2 100644 --- a/website_cookiebot/__manifest__.py +++ b/website_cookiebot/__manifest__.py @@ -5,7 +5,7 @@ "name": "Website Cookiebot", "summary": "Ask for cookies consent connecting with Cookiebot", "category": "Website", - "version": "16.0.1.0.0", + "version": "16.0.2.0.0", "author": "Trey (www.trey.es), Tecnativa, Odoo Community Association (OCA)", "website": "https://github.com/OCA/website", "license": "AGPL-3", diff --git a/website_cookiebot/migrations/16.0.2.0.0/post-migrate.py b/website_cookiebot/migrations/16.0.2.0.0/post-migrate.py new file mode 100644 index 0000000000..5789f20b54 --- /dev/null +++ b/website_cookiebot/migrations/16.0.2.0.0/post-migrate.py @@ -0,0 +1,10 @@ +# Copyright 2024 Tecnativa - David Vidal +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + # We're adding cookiebot_enabled to the website so it's easier to disable the + # cookiebot scripts temporarily + env["website"].search([("cookiebot_dgid", "!=", False)]).cookiebot_enabled = True diff --git a/website_cookiebot/models/website.py b/website_cookiebot/models/website.py index 4654117215..0cd3ebc3d6 100644 --- a/website_cookiebot/models/website.py +++ b/website_cookiebot/models/website.py @@ -11,3 +11,4 @@ class Website(models.Model): string="Cookiebot Domain Group ID", help="Get this code from Cookiebot to enable it on the website.", ) + cookiebot_enabled = fields.Boolean() diff --git a/website_cookiebot/templates/assets.xml b/website_cookiebot/templates/assets.xml index d84c8484d0..9c1e27e840 100644 --- a/website_cookiebot/templates/assets.xml +++ b/website_cookiebot/templates/assets.xml @@ -6,7 +6,9 @@ - +