Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
Often, customers ask for other colors, icons, menu styles and so on... Is it possible in Odoo, to create and select graphical theme for the backend as for the frontend (website) ? I mean, have two differents themes for each side and not the default one...
If the answer is yes, could you please drive me to the documentation part where it is explained or show me an example ?
As Leonardo said, it's possible. But basically because anything is possible when you have the source code, rather than it being a considered feature.
- Get useful information from the styles in your browser by enabling debug mode by changing the URL in your browser:
- not: .../web#vie..... etc
- yes: .../web?debug=#vie... etc
- This will prevent odoo from minifying the css files and you can see the name of the css files and browse them as they are in the source code.
- If you right click and inspect element (chrome or firefox are good for this) you can see the css styles of a DOM Element in your Odoo pages.
- Override the css using a custom module: I've never tried this, one of the below ought to work though.
- You could create a module and ensure that your css files are loaded later than Odoo's and that will override any styles you define, but wont neccessarily remove all odoo formatting (might be more desireable). I expect this would cause an odd lag as each css files is loaded in-turn during debug mode. But normal mode when the css is minified, it shouldn't be noticeable.
- You could try to find the xpath which includes the .css files inside a .xml document. Then in your own module use an xpath to replace the .css file includes (I don't have an example of this because I'm bad with xpaths, but they seem to be pretty powerful so it should be possible.). This might provide complete override of any css file which might be desireable (but would be harder to get right).
- I would avoid trying to replace any actual source files.
- As for changing the css files you're on your own. It would be nice if you could document your findings somewhere. This is something I might try and do in the future as well.
As I said at the start this isn't really an Odoo feature so there's no garauntee the css class names will stay the same over the course of new releases. Which means you'll have to come up with some extensive test and/or really pay attention to commits which effect css files defined by Odoo. If their files don't change your files shouldn't need to either.
Ok, so it's not easy but possible. As it's not a feature i need to pay attention to the modification of css files by the Odoo developers team. But i think it can be interesting for our customers so i will give a try. I will keep you informed about the results. My intention is to create new theme with statics css files and perhaps try to have some theme selector feature... but no real roadmap at this moment...
Thank's Will for your tips. I will use them for sure.
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 11/12/14, 4:57 AM|
|Seen: 6436 times|
|Last updated: 3/24/16, 12:58 PM|