-
-
Notifications
You must be signed in to change notification settings - Fork 696
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] website_cookiefirst: Migration to 17.0
- Loading branch information
1 parent
34628cf
commit 80264d5
Showing
10 changed files
with
109 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ Website Cookiefirst | |
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
This module integrates Odoo website with GDPR through the functionality | ||
of Cookiefirst <https://cookiefirst.com/>, you need to register your | ||
of Cookiefirst (https://cookiefirst.com), you need to register your | ||
website domain in Cookiefirst's portal. | ||
|
||
**Table of contents** | ||
|
@@ -48,6 +48,11 @@ To configure this module, you need to: | |
'00000000-0000-0000-0000-000000000000'). | ||
4. Click on "Save" button. | ||
|
||
⚠️ **Please note: if another cookie consent solution is installed (e.g. | ||
Cookiebot), the execution of the Cookiefirst script will be prevented. | ||
Make sure that no other cookie consent solution is installed when using | ||
the Cookiefirst module.** | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
|
@@ -73,6 +78,11 @@ Contributors | |
|
||
- Ioan Galan <[email protected]> | ||
|
||
- `NICO SOLUTIONS - ENGINEERING & | ||
IT <https://www.nico-solutions.de>`__: | ||
|
||
- Nils Coenen [email protected] | ||
|
||
Maintainers | ||
----------- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
- [Studio73](https://www.studio73.es): | ||
- [Studio73](https://www.studio73.es): | ||
- Ioan Galan \<<[email protected]>\> | ||
- [NICO SOLUTIONS - ENGINEERING & IT](https://www.nico-solutions.de): | ||
- Nils Coenen <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
This module integrates Odoo website with GDPR through the functionality | ||
of Cookiefirst \<https://cookiefirst.com/\>, you need to register your | ||
of Cookiefirst (https://cookiefirst.com), you need to register your | ||
website domain in Cookiefirst's portal. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | ||
<head> | ||
|
@@ -9,10 +8,11 @@ | |
|
||
/* | ||
:Author: David Goodger ([email protected]) | ||
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ | ||
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ | ||
:Copyright: This stylesheet has been placed in the public domain. | ||
|
||
Default cascading style sheet for the HTML output of Docutils. | ||
Despite the name, some widely supported CSS2 features are used. | ||
|
||
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to | ||
customize this style sheet. | ||
|
@@ -275,7 +275,7 @@ | |
margin-left: 2em ; | ||
margin-right: 2em } | ||
|
||
pre.code .ln { color: grey; } /* line numbers */ | ||
pre.code .ln { color: gray; } /* line numbers */ | ||
pre.code, code { background-color: #eeeeee } | ||
pre.code .comment, code .comment { color: #5C6576 } | ||
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } | ||
|
@@ -301,7 +301,7 @@ | |
span.pre { | ||
white-space: pre } | ||
|
||
span.problematic { | ||
span.problematic, pre.problematic { | ||
color: red } | ||
|
||
span.section-subtitle { | ||
|
@@ -371,7 +371,7 @@ <h1 class="title">Website Cookiefirst</h1> | |
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> | ||
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/website/tree/17.0/website_cookiefirst"><img alt="OCA/website" src="https://img.shields.io/badge/github-OCA%2Fwebsite-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/website-17-0/website-17-0-website_cookiefirst"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/website&target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p> | ||
<p>This module integrates Odoo website with GDPR through the functionality | ||
of Cookiefirst <<a class="reference external" href="https://cookiefirst.com/">https://cookiefirst.com/</a>>, you need to register your | ||
of Cookiefirst (<a class="reference external" href="https://cookiefirst.com">https://cookiefirst.com</a>), you need to register your | ||
website domain in Cookiefirst’s portal.</p> | ||
<p><strong>Table of contents</strong></p> | ||
<div class="contents local topic" id="contents"> | ||
|
@@ -396,6 +396,10 @@ <h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1> | |
‘00000000-0000-0000-0000-000000000000’).</li> | ||
<li>Click on “Save” button.</li> | ||
</ol> | ||
<p>⚠️ <strong>Please note: if another cookie consent solution is installed (e.g. | ||
Cookiebot), the execution of the Cookiefirst script will be prevented. | ||
Make sure that no other cookie consent solution is installed when using | ||
the Cookiefirst module.</strong></p> | ||
</div> | ||
<div class="section" id="bug-tracker"> | ||
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1> | ||
|
@@ -420,12 +424,19 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2> | |
<li>Ioan Galan <<a class="reference external" href="mailto:ioan@studio73.es">ioan@studio73.es</a>></li> | ||
</ul> | ||
</li> | ||
<li><a class="reference external" href="https://www.nico-solutions.de">NICO SOLUTIONS - ENGINEERING & | ||
IT</a>:<ul> | ||
<li>Nils Coenen <a class="reference external" href="mailto:nils.coenen@nico-solutions.de">nils.coenen@nico-solutions.de</a></li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</div> | ||
<div class="section" id="maintainers"> | ||
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2> | ||
<p>This module is maintained by the OCA.</p> | ||
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a> | ||
<a class="reference external image-reference" href="https://odoo-community.org"> | ||
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /> | ||
</a> | ||
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose | ||
mission is to support the collaborative development of Odoo features and | ||
promote its widespread use.</p> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from . import test_website | ||
from . import test_res_config_settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Copyright 2023 NICO SOLUTIONS - ENGINEERNG & IT, Nils Coenen | ||
# License APL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo.tests.common import TransactionCase | ||
|
||
|
||
class TestResConfigSettings(TransactionCase): | ||
def setUp(self): | ||
super().setUp() | ||
self.res_config_settings = self.env["res.config.settings"] | ||
|
||
def test_cookiefirst_enabled(self): | ||
website = self.env["website"].create( | ||
{ | ||
"name": "Test Website", | ||
"cookiefirst_identifier": "test_identifier", | ||
} | ||
) | ||
res_config_settings = self.res_config_settings.create( | ||
{ | ||
"website_id": website.id, | ||
"cookiefirst_identifier": "test_identifier", | ||
} | ||
) | ||
self.assertTrue(res_config_settings.cookiefirst_enabled) | ||
res_config_settings.cookiefirst_enabled = False | ||
self.assertFalse(website.cookiefirst_identifier) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Copyright 2023 NICO SOLUTIONS - ENGINEERNG & IT, Nils Coenen | ||
# License APL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo.tests.common import TransactionCase | ||
|
||
|
||
class TestWebsite(TransactionCase): | ||
def setUp(self): | ||
super().setUp() | ||
self.website = self.env["website"].create( | ||
{"name": "Test Website", "cookiefirst_identifier": "1234567890"} | ||
) | ||
|
||
def test_cookiefirst_identifier(self): | ||
self.assertEqual(self.website.cookiefirst_identifier, "1234567890") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,29 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
<record id="res_config_settings_view_form" model="ir.ui.view"> | ||
<field name="model">res.config.settings</field> | ||
<field name="inherit_id" ref="website.res_config_settings_view_form" /> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//div[@id='website_cookies_bar_setting']" position="inside"> | ||
<div class="o_setting_left_pane"> | ||
<field name="cookiefirst_enabled" /> | ||
</div> | ||
<div class="o_setting_right_pane"> | ||
<label for="cookiefirst_enabled" /> | ||
<div class="text-muted"> | ||
Add Cookiefirst functionality | ||
</div> | ||
<div | ||
class="content-group" | ||
attrs="{'invisible': [('cookiefirst_enabled', '=', False)]}" | ||
id="cookiefirst_fields" | ||
> | ||
<div class="row mt16"> | ||
<label | ||
class="col-md-3 o_light_label" | ||
string="Tracking ID" | ||
for="cookiefirst_identifier" | ||
/> | ||
<field | ||
name="cookiefirst_identifier" | ||
placeholder="00000000-0000-0000-0000-000000000000" | ||
attrs="{'required': [('cookiefirst_enabled', '!=', False)]}" | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
</xpath> | ||
</field> | ||
</record> | ||
<field name="name"> | ||
res.config.settings.view.form.inherit.cookiefirst | ||
</field> | ||
<field name="model">res.config.settings</field> | ||
<field name="inherit_id" ref="website.res_config_settings_view_form" /> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//setting[@id='website_cookies_bar_setting']" position="after"> | ||
<setting id="website_cookiefirst" help="Add Cookiefirst functionality"> | ||
<field name="cookiefirst_enabled" /> | ||
<div class="mt16" invisible="not cookiefirst_enabled"> | ||
<label | ||
class="col-md-3 o_light_label" | ||
string="Tracking ID" | ||
for="cookiefirst_identifier" | ||
/> | ||
<field | ||
name="cookiefirst_identifier" | ||
required="cookiefirst_enabled" | ||
placeholder="00000000-0000-0000-0000-000000000000" | ||
/> | ||
</div> | ||
</setting> | ||
</xpath> | ||
</field> | ||
</record> | ||
</odoo> |