Skip to content
Closed
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
36 changes: 28 additions & 8 deletions website_cookie_notice/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +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:

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.

* Add to company form remaining options https://github.com/eLBati/website/blob/cookie_law/website_cookie_notice/static/src/js/jquery.cookiecuttr.js#L27
* 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**>`_.
`here <https://github.com/OCA/website/issues/new?body=module:%20website_cookie_notice%0Aversion:%209.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.


Credits
Expand All @@ -38,6 +56,8 @@ Contributors
------------

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

Maintainer
----------
Expand Down
1 change: 0 additions & 1 deletion website_cookie_notice/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@
#
##############################################################################
from . import controllers
from . import models
15 changes: 7 additions & 8 deletions website_cookie_notice/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,19 @@
{
'name': 'Cookie notice',
'summary': 'Show cookie notice according to cookie law',
'version': '8.0.1.0.0',
'version': '9.0.2.0.0',
'category': 'Website',
'author': "Agile Business Group,Odoo Community Association (OCA)",
'author': "Agile Business Group, "
u"Antiun Ingeniería, S.L., "
"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',
'views/website.xml',
],
'qweb': [
],
'installable': False,
'installable': True,
'auto_install': False,
}
42 changes: 11 additions & 31 deletions website_cookie_notice/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#
# Copyright (C) 2015 Agile Business Group sagl (<http://www.agilebg.com>)
# Copyright (C) 2015 Lorenzo Battistini <lorenzo.battistini@agilebg.com>
# Copyright (C) 2015 Antiun Ingeniería S.L. <http://antiun.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
Expand All @@ -19,38 +20,17 @@
#
##############################################################################

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'}
151 changes: 0 additions & 151 deletions website_cookie_notice/i18n/en.po

This file was deleted.

Loading