Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

Cookie (law) bar jquery plugin

Subscribe

Get notified when there's activity on this post

This question has been flagged
widgetjqueryjspluginbarEUcookieslawpolitics
1 Reply
9000 Views
Avatar
Tobi

Hi,

I was trying to add to my Odoo website a cookie bar (according to EU law). I wanted to use one from http://www.primebox.co.uk/projects/jquery-cookiebar/ but unfortunately it doesn't work. I've edited <head> section as mentioned in Installing part.

Does anyone have information how can I enable this?

Also I wanted to make similar thing but with information about old webbrowser (I saw that Odoo needs a new ones to display website properly).

0
Avatar
Discard
Avatar
SonnyV
Best Answer

Hi,

Not sure if you still have this issue, since it's been a while since you asked this question. But I was facing the same problem as you are and finally found out how to implement the cookiewarning in my website.

Basically what you want to do is write a template that inherits from website.layout. Write an xpath expression here with attribute expr="//head" and position="inside", in this xpath, just place your css, js and the document.reay function.

So your template should look something like this:

<template id="header_lang" inherit_id="website.layout">
  <xpath expr="//head" position="inside">
    <script type="text/javascript" src="https://code.jquery.com/jquery.min.js"></script>
    <link rel="stylesheet" type="text/css" href="/xx_website_sale/static/src/css/jquery.cookiebar.css" />
    <script type="text/javascript" src="/xx_website_sale/static/src/js/jquery.cookiebar.js"/>
    <script type="text/javascript">
    $(document).ready(function(){
      $.cookieBar({
      });
    });
    </script>
  </xpath
</template>

Please upvote the answer if this helped you (:

2
Avatar
Discard
Tobi
Author

Hi, thanks for the answer but I've already learned about Odoo website MVC model and learned how to add JS scripts / qweb templates and all that stuff. But maybe someone will need that answer ;)

SonnyV

Did you use the same approach I did, or did you do something completely else? I do my js like this now, but if there is a better way to do this, I'd like to know :)

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
Extending/Overriding public widgets.
widget js
Avatar
Avatar
1
May 23
8713
Override Many2ManyListView under web.form_relational !! Solved
widget js
Avatar
Avatar
1
Jul 16
5074
problem with bind a js widget and xml Template to add it in html dev
widget templates js
Avatar
Avatar
1
Jun 23
3930
Sign App won't display PDF while custom JS widget added to the SystrayMenu
widget js sign
Avatar
0
Jan 21
3664
Error: "Could not find client action MyWidget" in widget [Odoo 12.0alpha1+e]
widget js master
Avatar
Avatar
Avatar
2
Dec 19
9456
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now