Odoo 12 Development Essentials
上QQ阅读APP看书,第一时间看更新

Installing Odoo system dependencies

To be able to run, Odoo needs some system packages and software. To get the version controlled source code, we need Git. To install and run Odoo, we need Python 3.5 or later, pip for Python 3, and a few system dependencies needed for some Python packages:

$ sudo apt update
$ sudo apt upgrade
$ sudo apt install git # Install Git
$ sudo apt install python3-dev python3-pip # Python 3 for dev
$ sudo apt install build-essential libxslt-dev \
libzip-dev
libldap2-dev libsasl2-dev libssl-dev

Odoo releases 9, 10, and 11 require the less CSS preprocessor. So, you need to install it if you need to also these Odoo versions:

$ sudo apt install npm  # Install Node.js and its package manager
$ sudo ln -s /usr/bin/nodejs /usr/bin/node  # node runs Node.js
$ sudo npm install -g less less-plugin-clean-css  # Install less

The preceding command is not required to run Odoo 12, but it is often the case that you need to also work on these versions and, if this is the case, you will end up needing it.

Changed in Odoo 12 
The CSS preprocessor used changed from less to Sass. This means that less is no longer required to run Odoo. The Sass compiler does not require additional installation steps, since it is made available by libsass-python, a Python dependency of Odoo 12. The reasons for the change include: bootstrap 4 changing from less to Sass, existing Python bindings, and avoiding Node.js (or Ruby) dependencies.