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

[12.0] [MIG] website_cookiefirst #1045

Open
wants to merge 9 commits into
base: 12.0
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions setup/website_cookiefirst/odoo/addons/website_cookiefirst
6 changes: 6 additions & 0 deletions setup/website_cookiefirst/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
91 changes: 91 additions & 0 deletions website_cookiefirst/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
===================
Website Cookiefirst
===================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:9c7cd055b6990a9bb88051b1881add45f46c4dc8d5eae8e92de5e1df749d4f88
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fwebsite-lightgray.png?logo=github
:target: https://github.com/OCA/website/tree/12.0/website_cookiefirst
:alt: OCA/website
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/website-12-0/website-12-0-website_cookiefirst
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/website&target_branch=12.0
:alt: Try me on Runboat

|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 website
domain in Cookiefirst's portal.

**Table of contents**

.. contents::
:local:

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

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.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/website/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/website/issues/new?body=module:%20website_cookiefirst%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* Studio73

Contributors
~~~~~~~~~~~~

* `Studio73 <https://www.studio73.es>`__:
* Ioan Galan <[email protected]>
* `Binhex Systems Solutions <https://binhex.cloud/>`__:
* Deriman Alonso <[email protected]>

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

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.

This module is part of the `OCA/website <https://github.com/OCA/website/tree/12.0/website_cookiefirst>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions website_cookiefirst/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
18 changes: 18 additions & 0 deletions website_cookiefirst/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2021 Studio73 - Ioan Galan <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Website Cookiefirst",
"summary": "Cookiefirst integration",
"category": "Website",
"version": "12.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,
}
36 changes: 36 additions & 0 deletions website_cookiefirst/data/cookies_policy.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="cookies" model="ir.ui.view">
<field name="name">Cookies Policy</field>
<field name="type">qweb</field>
<field name="key">website.cookies</field>
<field name="arch" type="xml">
<t name="Cookies Policy" t-name="website.cookies">
<t t-call="website.layout">
<div id="wrap">
<div class="oe_structure">
<section data-snippet-id="title">
<h1 class="text-center">Cookie Declaration</h1>
</section>
</div>
<section class="mb-5 mt-5">
<div class="container">
<div class="row">
<div class="col-12">
<div id="cookiefirst-policy-page" />
</div>
</div>
</div>
</section>
<div class="oe_structure" />
</div>
</t>
</t>
</field>
</record>
<record id="cookies_page" model="website.page">
<field name="url">/legal/cookies-policy</field>
<field name="website_published">True</field>
<field name="view_id" ref="cookies" />
</record>
</odoo>
70 changes: 70 additions & 0 deletions website_cookiefirst/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * website_cookiefirst
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-11-14 16:36+0000\n"
"Last-Translator: mymage <[email protected]>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: website_cookiefirst
#: model_terms:ir.ui.view,arch_db:website_cookiefirst.res_config_settings_view_form
msgid "00000000-0000-0000-0000-000000000000"
msgstr "00000000-0000-0000-0000-000000000000"

#. module: website_cookiefirst
#: model_terms:ir.ui.view,arch_db:website_cookiefirst.res_config_settings_view_form
msgid "Add Cookiefirst functionality"
msgstr "Aggiungere la funzionalità Cookiefirst"

#. module: website_cookiefirst
#: model:ir.model,name:website_cookiefirst.model_res_config_settings
msgid "Config Settings"
msgstr "Impostazioni configurazione"

#. module: website_cookiefirst
#: model_terms:ir.ui.view,arch_db:website_cookiefirst.cookies
#: model_terms:website.page,arch_db:website_cookiefirst.cookies_page
msgid "Cookie Declaration"
msgstr "Dichiarazione cookie"

#. module: website_cookiefirst
#: model:ir.model.fields,field_description:website_cookiefirst.field_res_config_settings__cookiefirst_identifier
#: model:ir.model.fields,field_description:website_cookiefirst.field_website__cookiefirst_identifier
msgid "Cookiefirst ID"
msgstr "ID Cookiefirst"

#. module: website_cookiefirst
#: model_terms:ir.ui.view,arch_db:website_cookiefirst.frontend_layout
msgid "Cookies Policy"
msgstr "Politica dei cookie"

#. module: website_cookiefirst
#: model:ir.model.fields,help:website_cookiefirst.field_res_config_settings__cookiefirst_identifier
#: model:ir.model.fields,help:website_cookiefirst.field_website__cookiefirst_identifier
msgid "This field holds the ID, needed for Cookiefirst functionality."
msgstr "Questo campo contiene l'ID, necessario per la funzionalità Cookiefirst."

#. module: website_cookiefirst
#: model_terms:ir.ui.view,arch_db:website_cookiefirst.res_config_settings_view_form
msgid "Tracking ID"
msgstr "ID tracciatura"

#. module: website_cookiefirst
#: model:ir.model.fields,field_description:website_cookiefirst.field_res_config_settings__cookiefirst_enabled
msgid "Use Cookiefirst"
msgstr "Utilizza Cookiefirst"

#. module: website_cookiefirst
#: model:ir.model,name:website_cookiefirst.model_website
msgid "Website"
msgstr "Sito web"
67 changes: 67 additions & 0 deletions website_cookiefirst/i18n/website_cookiefirst.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * website_cookiefirst
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \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_cookiefirst
#: model_terms:ir.ui.view,arch_db:website_cookiefirst.res_config_settings_view_form
msgid "00000000-0000-0000-0000-000000000000"
msgstr ""

#. module: website_cookiefirst
#: model_terms:ir.ui.view,arch_db:website_cookiefirst.res_config_settings_view_form
msgid "Add Cookiefirst functionality"
msgstr ""

#. module: website_cookiefirst
#: model:ir.model,name:website_cookiefirst.model_res_config_settings
msgid "Config Settings"
msgstr ""

#. module: website_cookiefirst
#: model_terms:ir.ui.view,arch_db:website_cookiefirst.cookies
#: model_terms:website.page,arch_db:website_cookiefirst.cookies_page
msgid "Cookie Declaration"
msgstr ""

#. module: website_cookiefirst
#: model:ir.model.fields,field_description:website_cookiefirst.field_res_config_settings__cookiefirst_identifier
#: model:ir.model.fields,field_description:website_cookiefirst.field_website__cookiefirst_identifier
msgid "Cookiefirst ID"
msgstr ""

#. module: website_cookiefirst
#: model_terms:ir.ui.view,arch_db:website_cookiefirst.frontend_layout
msgid "Cookies Policy"
msgstr ""

#. module: website_cookiefirst
#: model:ir.model.fields,help:website_cookiefirst.field_res_config_settings__cookiefirst_identifier
#: model:ir.model.fields,help:website_cookiefirst.field_website__cookiefirst_identifier
msgid "This field holds the ID, needed for Cookiefirst functionality."
msgstr ""

#. module: website_cookiefirst
#: model_terms:ir.ui.view,arch_db:website_cookiefirst.res_config_settings_view_form
msgid "Tracking ID"
msgstr ""

#. module: website_cookiefirst
#: model:ir.model.fields,field_description:website_cookiefirst.field_res_config_settings__cookiefirst_enabled
msgid "Use Cookiefirst"
msgstr ""

#. module: website_cookiefirst
#: model:ir.model,name:website_cookiefirst.model_website
msgid "Website"
msgstr ""
2 changes: 2 additions & 0 deletions website_cookiefirst/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import res_config_settings
from . import website
29 changes: 29 additions & 0 deletions website_cookiefirst/models/res_config_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright 2021 Studio73 - Ioan Galan <[email protected]>
# 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",
)
13 changes: 13 additions & 0 deletions website_cookiefirst/models/website.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2021 Studio73 - Ioan Galan <[email protected]>
# 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.",
)
6 changes: 6 additions & 0 deletions website_cookiefirst/readme/CONFIGURE.rst
Original file line number Diff line number Diff line change
@@ -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.
4 changes: 4 additions & 0 deletions website_cookiefirst/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* `Studio73 <https://www.studio73.es>`__:
* Ioan Galan <[email protected]>
* `Binhex Systems Solutions <https://binhex.cloud/>`__:
* Deriman Alonso <[email protected]>
3 changes: 3 additions & 0 deletions website_cookiefirst/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This module integrates Odoo website with GDPR through the functionality of
`Cookiefirst <https://cookiefirst.com/>`, you need to register your website
domain in Cookiefirst's portal.
Binary file added website_cookiefirst/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading