Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
43 changes: 31 additions & 12 deletions website_cookie_notice/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,49 @@
Cookie notice
=============

This module adds the cookie notice, according to the `cookie law <http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=CELEX:32002L0058:en:HTML>`_, to your website

This module adds the cookie notice, according to the `european cookie law
<http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=CELEX:32002L0058:en:HTML>`_,
to your website.

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

To change default options, go to your company form, click on 'cookie notice' tab and edit module options
To change the cookie message:

* Go to *Settings > Technical > User Interface > Views*.
* Search for the view called *cookiebanner*.
* Change as you wish. Remember that you will probably lose translations then.

If you are developing a theme for Odoo, remember that this message has the
``cc-cookies`` class. You can style it at will too.

Known issues / Roadmap
Known Issues / Roadmap
======================

TODO
----
* If you are using this module in version < 8.0.2.0.0 and update it, any other
module that modifies the ``res.company`` view will break in the next update
if Odoo decides to update it before this one. To avoid that:

* Add to company form remaining options https://github.com/eLBati/website/blob/cookie_law/website_cookie_notice/static/src/js/jquery.cookiecuttr.js#L27
1. Stop your server.
2. Update only this module: ``odoo.py -u website_cookie_notice``.
3. Stop your server.
4. Update all other modules: ``odoo.py -u all``.
5. Start your server.

* Before version 8.0.2.0.0 of this module, users had the ability to configure
the message functionality and appearance from the main company form.

Now, the message is generated in a view. This means that after upgrading to
>= 8.0.2.0.0 you will lose your previous customized messages. If you want to
customize it, please follow steps in the configuration section.

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 smashing it by providing a detailed and welcomed feedback
`here <https://github.com/OCA/website/issues/new?body=module:%20website_cookie_notice%0Aversion:%208.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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 smashing it by providing a detailed and welcomed feedback.

Credits
=======
Expand All @@ -38,6 +55,8 @@ Contributors
------------

* Lorenzo Battistini <lorenzo.battistini@agilebg.com>
* Rafael Blasco <rafabn@antiun.com>
* Jairo Llopis <yajo.sk8@gmail.com>

Maintainer
----------
Expand Down
22 changes: 3 additions & 19 deletions website_cookie_notice/__init__.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Agile Business Group sagl (<http://www.agilebg.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# Copyright 2015-2016 Lorenzo Battistini - Agile Business Group
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import controllers
from . import models
33 changes: 8 additions & 25 deletions website_cookie_notice/__openerp__.py
Original file line number Diff line number Diff line change
@@ -1,39 +1,22 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Agile Business Group sagl (<http://www.agilebg.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# Copyright 2015-2016 Lorenzo Battistini - Agile Business Group
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
'name': 'Cookie notice',
'summary': 'Show cookie notice according to cookie law',
'version': '8.0.1.0.0',
'version': '9.0.1.0.0',
'category': 'Website',
'author': "Agile Business Group,Odoo Community Association (OCA)",
'author': "Agile Business Group, "
"Tecnativa, "
"Odoo Community Association (OCA)",
'website': 'http://www.agilebg.com',
'license': 'AGPL-3',
'depends': [
'website',
'website_legal_page',
],
'data': [
'website.xml',
'views/res_company_view.xml',
],
'qweb': [
'views/website.xml',
],
'installable': False,
'auto_install': False,
Expand Down
21 changes: 3 additions & 18 deletions website_cookie_notice/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Agile Business Group sagl (<http://www.agilebg.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# Copyright 2015-2016 Lorenzo Battistini - Agile Business Group
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import main
63 changes: 13 additions & 50 deletions website_cookie_notice/controllers/main.py
Original file line number Diff line number Diff line change
@@ -1,56 +1,19 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Agile Business Group sagl (<http://www.agilebg.com>)
# Copyright (C) 2015 Lorenzo Battistini <lorenzo.battistini@agilebg.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# Copyright 2015-2016 Lorenzo Battistini - Agile Business Group
# Copyright 2015 Antiun Ingeniería S.L. <http://antiun.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from openerp.addons.web import http
from openerp.http import request

CONFIG_FIELDS = [
'cookieAnalytics',
'cookieMessage',
'cookiePolicyLink',
'cookieOverlayEnabled',
'cookieAnalyticsMessage',
'cookieErrorMessage',
'cookieDeclineButton',
'cookieAcceptButton',
'cookieResetButton',
'cookieWhatAreTheyLink',
'cookieAcceptButtonText',
'cookieDeclineButtonText',
'cookieResetButtonText',
]
from openerp import http


class CookieNotice(http.Controller):
@http.route(
['/cookie_notice/get_config'], type='json', auth="public",
website=True)
def get_cookie_notice_config(self):
cr, uid, context, pool = (
request.cr, request.uid, request.context, request.registry)
user_model = pool['res.users']
company_model = pool['res.company']
company_id = user_model._get_company(cr, uid, context)
company = company_model.browse(cr, uid, company_id, context)
res = {}
for field in CONFIG_FIELDS:
res[field] = getattr(company, field)
return res
"/website_cookie_notice/ok", auth="public", website=True, type='json',
methods=['POST'])
def accept_cookies(self):
"""Stop spamming with cookie banner."""
http.request.httpsession["accepted_cookies"] = True
http.request.env['ir.ui.view'].search([
('type', '=', 'qweb')
]).clear_caches()
return {'result': 'ok'}
36 changes: 36 additions & 0 deletions website_cookie_notice/i18n/ca.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * website_cookie_notice
#
# Translators:
# Carles Antolí <carlesantoli@hotmail.com>, 2016
msgid ""
msgstr ""
"Project-Id-Version: website (8.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-02-25 14:25+0000\n"
"PO-Revision-Date: 2016-02-24 11:52+0000\n"
"Last-Translator: Pedro M. Baeza <pedro.baeza@gmail.com>\n"
"Language-Team: Catalan (http://www.transifex.com/oca/OCA-website-8-0/language/ca/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: ca\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: website_cookie_notice
#: view:website:website_cookie_notice.message
msgid ""
". To disable them, configure your browser properly. If you keep using this "
"website, you are accepting those."
msgstr ""

#. module: website_cookie_notice
#: view:website:website_cookie_notice.message
msgid "We use cookies in this website. Read about them in our"
msgstr "Utilitzem cookies en aquest lloc web. Llegir sobre elles en el nostre"

#. module: website_cookie_notice
#: view:website:website_cookie_notice.message
msgid "privacy policy"
msgstr "Política privacitat"
36 changes: 36 additions & 0 deletions website_cookie_notice/i18n/de.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * website_cookie_notice
#
# Translators:
# Rudolf Schnapka <rs@techno-flex.de>, 2016
msgid ""
msgstr ""
"Project-Id-Version: website (8.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-02-25 14:25+0000\n"
"PO-Revision-Date: 2016-02-24 11:52+0000\n"
"Last-Translator: Pedro M. Baeza <pedro.baeza@gmail.com>\n"
"Language-Team: German (http://www.transifex.com/oca/OCA-website-8-0/language/de/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: de\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: website_cookie_notice
#: view:website:website_cookie_notice.message
msgid ""
". To disable them, configure your browser properly. If you keep using this "
"website, you are accepting those."
msgstr ""

#. module: website_cookie_notice
#: view:website:website_cookie_notice.message
msgid "We use cookies in this website. Read about them in our"
msgstr "Wir verwenden Cookies in dieser Webseite. Lesen Sie mehr zu diesen in unserer"

#. module: website_cookie_notice
#: view:website:website_cookie_notice.message
msgid "privacy policy"
msgstr "Datenschutzerklärung"
34 changes: 34 additions & 0 deletions website_cookie_notice/i18n/el_GR.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * website_cookie_notice
#
# Translators:
# Goutoudis Kostas <goutoudis@gmail.com>, 2015
msgid ""
msgstr ""
"Project-Id-Version: website (8.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-11-28 02:04+0000\n"
"PO-Revision-Date: 2015-11-24 16:05+0000\n"
"Last-Translator: Goutoudis Kostas <goutoudis@gmail.com>\n"
"Language-Team: Greek (Greece) (http://www.transifex.com/oca/OCA-website-8-0/language/el_GR/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: el_GR\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: website_cookie_notice
#: view:website:website_cookie_notice.message
msgid ". To disable them, configure your browser properly. If you keep using this website, you are accepting those."
msgstr ". Για να απενεργοποιήσετε τα cookies, ρυθμίσετε κατάλληλα τον browser σας. Εάν συνεχίσετε τη χρήση αυτού του ιστότοπου, αποδέχεστε αυτούς τους όρους."

#. module: website_cookie_notice
#: view:website:website_cookie_notice.message
msgid "We use cookies in this website. Read about them in our"
msgstr "Χρησιμοποιούμε cookies σε αυτόν τον ιστότοπο. Διαβάστε σχετικά την"

#. module: website_cookie_notice
#: view:website:website_cookie_notice.message
msgid "privacy policy"
msgstr "πολιτική απορρήτου"
Loading