Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TA#68599 [FIX] website_cookieconsent : plugin loading #128

Merged
merged 3 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 47 additions & 6 deletions website_cookieconsent/README.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,55 @@
=====================
WEBSITE COOKIECONSENT
Website CookieConsent
=====================
This module displays a cookie consent banner to your website.

Example of previews in french and english language:
This module integrates Odoo website with [Orestbida's CookieConsent plugin](https://github.com/orestbida/cookieconsent).

.. image:: static/description/cookieconsent_en.png
**Table of contents**

.. image:: static/description/cookieconsent_fr.png
.. contents::
:local:

Configuration
=============

To configure this module, you need to:

# . Go to **Website > Configuration > Settings**
# . On the `Website` settings tab, then select the website to configure
# . Scroll down to the `CookieConsent` section.
# . Toggle `Use CookieConsent`.
# . Click on `Save` button.

.. image:: static/description/website_configuration.png

IMPORTANT: The `CookieConsent` section will only be applied to the website selected in the `Website` settings tab.
As it already has been mentioned that `Settings on this page will apply to this website`.
So if you want to apply the same settings to another website, you need to repeat the same steps for that website.

.. image:: static/description/website_selection.png

After that, when you visit the website, you will see a banner at the bottom of the page asking for your consent to use cookies.

.. image:: static/description/cookieconsent.png

When you click on the `Manage preferences` button, you will see a pop up window with containing strictly necessary cookies and analytics cookies.

.. image:: static/description/cookieconsent_modal.png

Notes
=====

The files inside `/static/src/js`, `/static/src/css` and `/static/src/i18n` are the default configuration, stylesheets
and locales used by CookieConsent.

The [upstream maintainer](https://github.com/orestbida/cookieconsent) offers a [playground](https://playground.cookieconsent.orestbida.com/)
to test the extent of the customization.

Contributors
------------
============

* Numigi (tm) and all its contributors (https://bit.ly/numigiens)

More information
================
* Meet us at https://bit.ly/numigi-com
2 changes: 2 additions & 0 deletions website_cookieconsent/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# Copyright 2024 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models

Check notice on line 4 in website_cookieconsent/__init__.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

website_cookieconsent/__init__.py#L4

'.models' imported but unused (F401)
4 changes: 3 additions & 1 deletion website_cookieconsent/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
"category": "Website",
"version": "14.0.1.0.0",
"author": "Numigi",
"maintainer": "Numigi",
"website": "https://bit.ly/numigi-com",
"license": "AGPL-3",
"depends": ["website_cookiefirst"],
"depends": ["website"],
"data": [
"views/assets.xml",
"views/res_config_settings_views.xml",
Expand Down
48 changes: 44 additions & 4 deletions website_cookieconsent/i18n/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,56 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-09-04 00:38+0000\n"
"PO-Revision-Date: 2024-09-04 00:38+0000\n"
"POT-Creation-Date: 2024-09-06 02:52+0000\n"
"PO-Revision-Date: 2024-09-06 02:52+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: website_cookieconsent
#: model:ir.model,name:website_cookieconsent.model_res_config_settings
msgid "Config Settings"
msgstr "Paramètres"

#. module: website_cookieconsent
#: model:ir.model.fields,field_description:website_cookieconsent.field_res_config_settings__display_name
#: model:ir.model.fields,field_description:website_cookieconsent.field_website__display_name
msgid "Display Name"
msgstr "Nom affiché"

#. module: website_cookieconsent
#: model_terms:ir.ui.view,arch_db:website_cookieconsent.res_config_settings_view_form
msgid "Add CookieConsent functionality"
msgstr "Ajouter la fonction CookieConsent"
msgid "Display a cookie banner on your website"
msgstr "Afficher une bannière de cookies sur votre site web"

#. module: website_cookieconsent
#: model:ir.model.fields,help:website_cookieconsent.field_res_config_settings__website_cookieconsent_enabled
#: model:ir.model.fields,help:website_cookieconsent.field_website__cookieconsent_enabled
msgid "Display a cookie banner on your website."
msgstr "Afficher une bannière de cookies sur votre site web."

#. module: website_cookieconsent
#: model:ir.model.fields,field_description:website_cookieconsent.field_res_config_settings__id
#: model:ir.model.fields,field_description:website_cookieconsent.field_website__id
msgid "ID"
msgstr ""

#. module: website_cookieconsent
#: model:ir.model.fields,field_description:website_cookieconsent.field_res_config_settings____last_update
#: model:ir.model.fields,field_description:website_cookieconsent.field_website____last_update
msgid "Last Modified on"
msgstr "Dernière modification le"

#. module: website_cookieconsent
#: model:ir.model.fields,field_description:website_cookieconsent.field_res_config_settings__website_cookieconsent_enabled
#: model:ir.model.fields,field_description:website_cookieconsent.field_website__cookieconsent_enabled
msgid "Use CookieConsent"
msgstr "Utiliser CookieConsent"

#. module: website_cookieconsent
#: model:ir.model,name:website_cookieconsent.model_website
msgid "Website"
msgstr "Site web"
5 changes: 5 additions & 0 deletions website_cookieconsent/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright 2024 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import res_config_settings

Check notice on line 4 in website_cookieconsent/models/__init__.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

website_cookieconsent/models/__init__.py#L4

'.res_config_settings' imported but unused (F401)
from . import website

Check notice on line 5 in website_cookieconsent/models/__init__.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

website_cookieconsent/models/__init__.py#L5

'.website' imported but unused (F401)
14 changes: 14 additions & 0 deletions website_cookieconsent/models/res_config_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2024 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models


class ResConfigSettings(models.TransientModel):
_inherit = "res.config.settings"

website_cookieconsent_enabled = fields.Boolean(
related="website_id.cookieconsent_enabled",
string="Use CookieConsent",
readonly=False,
)
12 changes: 12 additions & 0 deletions website_cookieconsent/models/website.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright 2024 - today Numigi (tm) and all its contributors (https://bit.ly/numigiens)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models


class Website(models.Model):
_inherit = "website"

cookieconsent_enabled = fields.Boolean(
string="Use CookieConsent", help="Display a cookie banner on your website."
)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@
}
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@
}
]
}
}
}
Loading
Loading