after running odoo server and trying to go to localhost:8069 I got error in webpage saying "TypeError: CleanCSS is not a function".
2 Answers
I got the same problem and I found this solution from https://github.com/odoo/odoo/issues/9113 by daniel-adb-fa, that worked fine and easy for me (I needed sudo because I was not logged as root):
Install odoo 9.0 from the nightly repo according to documentation.
Install the current versions of less and less-plugin-css via npm. This will install the versions to /usr/local/bin:
sudo npm install -g less less-plugin-clean-cssInstall the symlink /usr/bin/node. This can be done manually, but you can also use an official apt-package for it:
sudo apt install nodejs-legacyNow the link to lessc has to be patched to point to the version installed by npm instead of the (broken) distribution version:
sudo rm /usr/bin/lessc sudo ln -s /usr/local/bin/lessc /usr/bin/lesscThis should work, but an update of the distribution package might still break the patched link later. To avoid this, its possible to do:
sudo apt-mark hold node-less
Then I restarted odoo service with:
sudo service odoo-server start
and don't forget to clear your browser cache after that.
Good luck!
Found solution on github
go to file /openerp/addons/base/ir/ir_qweb.py
in line 1685 which has the following code :
return [lessc, '-', '--clean-css','--no-js', '--no-color', '--include-path=%s' % lesspath]
remove item '--clean-css' from this list and save and everything will run correctly
- 141
- 1
- 6
