From 3543fa799a172bcc7260bebb1a12c3913cf5c84b Mon Sep 17 00:00:00 2001 From: Ioan Galan Date: Thu, 7 Jan 2021 11:40:50 +0100 Subject: [PATCH 01/14] [13.0][ADD] website_cookiefirst: Cookiefirst integration --- website_cookiefirst/__init__.py | 1 + website_cookiefirst/__manifest__.py | 18 ++++++++ website_cookiefirst/data/cookies_policy.xml | 36 +++++++++++++++ website_cookiefirst/models/__init__.py | 2 + .../models/res_config_settings.py | 29 ++++++++++++ website_cookiefirst/models/website.py | 13 ++++++ website_cookiefirst/readme/CONFIGURE.rst | 6 +++ website_cookiefirst/readme/CONTRIBUTORS.rst | 2 + website_cookiefirst/readme/DESCRIPTION.rst | 3 ++ .../static/description/icon.png | Bin 0 -> 8975 bytes website_cookiefirst/views/portal_template.xml | 27 +++++++++++ .../views/res_config_settings_views.xml | 43 ++++++++++++++++++ 12 files changed, 180 insertions(+) create mode 100644 website_cookiefirst/__init__.py create mode 100644 website_cookiefirst/__manifest__.py create mode 100644 website_cookiefirst/data/cookies_policy.xml create mode 100644 website_cookiefirst/models/__init__.py create mode 100644 website_cookiefirst/models/res_config_settings.py create mode 100644 website_cookiefirst/models/website.py create mode 100644 website_cookiefirst/readme/CONFIGURE.rst create mode 100644 website_cookiefirst/readme/CONTRIBUTORS.rst create mode 100644 website_cookiefirst/readme/DESCRIPTION.rst create mode 100644 website_cookiefirst/static/description/icon.png create mode 100644 website_cookiefirst/views/portal_template.xml create mode 100644 website_cookiefirst/views/res_config_settings_views.xml diff --git a/website_cookiefirst/__init__.py b/website_cookiefirst/__init__.py new file mode 100644 index 0000000000..0650744f6b --- /dev/null +++ b/website_cookiefirst/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/website_cookiefirst/__manifest__.py b/website_cookiefirst/__manifest__.py new file mode 100644 index 0000000000..9b536c2b1c --- /dev/null +++ b/website_cookiefirst/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright 2021 Studio73 - Ioan Galan +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +{ + "name": "Website Cookiefirst", + "summary": "Cookiefirst integration", + "category": "Website", + "version": "13.0.1.0.0", + "author": "Studio73, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/website", + "license": "AGPL-3", + "depends": ["portal", "website"], + "data": [ + "data/cookies_policy.xml", + "views/portal_template.xml", + "views/res_config_settings_views.xml", + ], + "installable": True, +} diff --git a/website_cookiefirst/data/cookies_policy.xml b/website_cookiefirst/data/cookies_policy.xml new file mode 100644 index 0000000000..4117f942a4 --- /dev/null +++ b/website_cookiefirst/data/cookies_policy.xml @@ -0,0 +1,36 @@ + + + + Cookies Policy + qweb + website.cookies + + + +
+
+
+

Cookie Declaration

+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + + + + /legal/cookies-policy + True + + + diff --git a/website_cookiefirst/models/__init__.py b/website_cookiefirst/models/__init__.py new file mode 100644 index 0000000000..ba62e1412d --- /dev/null +++ b/website_cookiefirst/models/__init__.py @@ -0,0 +1,2 @@ +from . import res_config_settings +from . import website diff --git a/website_cookiefirst/models/res_config_settings.py b/website_cookiefirst/models/res_config_settings.py new file mode 100644 index 0000000000..ac0de0df1d --- /dev/null +++ b/website_cookiefirst/models/res_config_settings.py @@ -0,0 +1,29 @@ +# Copyright 2021 Studio73 - Ioan Galan +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class ResConfigSettings(models.TransientModel): + _inherit = "res.config.settings" + + @api.depends("website_id.cookiefirst_identifier") + def _compute_cookiefirst_enabled(self): + for record in self: + record.update({"cookiefirst_enabled": bool(record.cookiefirst_identifier)}) + + def _inverse_cookiefirst_enabled(self): + for record in self: + if not record.cookiefirst_enabled: + record.website_id.update({"cookiefirst_identifier": False}) + + cookiefirst_identifier = fields.Char( + string="Cookiefirst ID", + related="website_id.cookiefirst_identifier", + readonly=False, + ) + cookiefirst_enabled = fields.Boolean( + string="Use Cookiefirst", + compute="_compute_cookiefirst_enabled", + inverse="_inverse_cookiefirst_enabled", + ) diff --git a/website_cookiefirst/models/website.py b/website_cookiefirst/models/website.py new file mode 100644 index 0000000000..0762d8f3db --- /dev/null +++ b/website_cookiefirst/models/website.py @@ -0,0 +1,13 @@ +# Copyright 2021 Studio73 - Ioan Galan +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class Website(models.Model): + _inherit = "website" + + cookiefirst_identifier = fields.Char( + string="Cookiefirst ID", + help="This field holds the ID, needed for Cookiefirst functionality.", + ) diff --git a/website_cookiefirst/readme/CONFIGURE.rst b/website_cookiefirst/readme/CONFIGURE.rst new file mode 100644 index 0000000000..4e58e2c548 --- /dev/null +++ b/website_cookiefirst/readme/CONFIGURE.rst @@ -0,0 +1,6 @@ +To configure this module, you need to: + +#. Go to **Website > Configuration > Settings** +#. Search 'Cookiefirst' option. +#. Fill in your 'Cookiefirst ID' (e.g. '00000000-0000-0000-0000-000000000000'). +#. Click on "Save" button. diff --git a/website_cookiefirst/readme/CONTRIBUTORS.rst b/website_cookiefirst/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..946245f774 --- /dev/null +++ b/website_cookiefirst/readme/CONTRIBUTORS.rst @@ -0,0 +1,2 @@ +* `Studio73 `__: + * Ioan Galan diff --git a/website_cookiefirst/readme/DESCRIPTION.rst b/website_cookiefirst/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..98446435dc --- /dev/null +++ b/website_cookiefirst/readme/DESCRIPTION.rst @@ -0,0 +1,3 @@ +This module integrates Odoo website with GDPR through the functionality of +`Cookiefirst `, you need to register your website +domain in Cookiefirst's portal. diff --git a/website_cookiefirst/static/description/icon.png b/website_cookiefirst/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..818c6ac91407c7540c6b8ac8375f0aa6840b4a86 GIT binary patch literal 8975 zcmV+qBk z!@>v-e71p$Iq^?%aH-&ua7-17?YooUa|&E>{b#@xbx{2w8x@gIts;V02E5{BG>z~i zq_RL-Dy#*!Mg;k~Dp|EvfzPF~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