Ok, so recently I have got a mission from the customer - the object was to place cookie notice onto his Odoo page. He bought an app for that but there was something wrong. It is a good opportunity to write a tutorial on how to add cookie notice to Odoo. You won't need any technical skills other than copy&paste. Of course, I always recommend having a backup prior to any technical edits.
Navigate to your main page
You have to do it as logged in user. You should be able to see some buttons on the top including "Edit", Customise" & "Promote". If you can't see them you need to go to the Settings and inside of your user set the "Website" permissions.
Get the code
Open another tab in your browser and visit https://cookieconsent.insites.com/
There is a large "Download" button, click it and just copy the code. You can also customise the code using a web tool or your knowledge. The basic code would look like(you can also copy it from here):
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.0/cookieconsent.min.css" /> <script src="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.0/cookieconsent.min.js"></script> <script> window.addEventListener("load", function(){ window.cookieconsent.initialise({ "palette": { "popup": { "background": "#000" }, "button": { "background": "#f1d600" } } })}); </script>
Paste the code
Click the "customise" link and then Edit CSS/HTML. Navigate to the "Web Layout" and paste the code in the "head" section.
I guess that the code would work even if you paste it in the footer but we should stick to general rules. Maybe you or someone else will be working on the Odoo later and it will be just easier.
Hit Save and check if it works... That's all:)
There is more...
Cookie Consent by
As I always say - make a module for that so it is permanent. Now, when you know where you have to paste the code to make it work, you can develop a simple module for that. It is up to you but it is always better to have a module than to repeat yourself in the future.
See my module for Cookie Notice in Odoo
How to add cookie notice to Odoo
Simple and free solution
Odoo Technical Tutorial