Установка - Odoo 11.0

There are multiple ways to install Odoo, or not install it at all, depending on the intended use case.

В этом документе рассматривается большинство параметров установки.

Online
Это самый простой способ использовать Odoo. Лучше всего подходит для первого ознакомления с системой
С помощью инсталлятора
Подходит для тестирования Odoo, разработки модулей и может использоваться для долгосрочного использования при необходимости выполнения дополнительных работ по обслуживанию.
Из исходников
Обеспечивает большую гибкость: например, можно запустить несколько версий Odoo в одной системе. Хорошо подходит и для разработки модулей, и для продакшн.
Docker
Если вы обычно используете docker для разработки или развертывания, доступен официальный образ docker.

Версии Odoo

Существуют две версии Editions Odoo: Community и Enterprise. Использование версии Enterprise возможно на нашей SaaS, исходный код доступен корпоративным клиентам и партнерам. Версия Community доступна всем.

Если вы уже используете версию Community и хотите перейти на Enterprise, обратитесь к От Community к Enterprise (кроме Из исходников).

Online

Демонстрационная

Чтобы просто получить краткое представление об Odoo, доступны экземпляры demo. Они представляют собой установки, которые живут в течение нескольких часов, и могут использоваться без каких-либо обязательств.

Для экземпляров Demo не требуется локальная установка, а только веб-браузер.

SaaS

Самый простой способ начать, полностью управляемый и перенесенный с помощью Odoo S.A.,Odoo SaaS предоставляет частный доступ и запускается бесплатно. Его можно использовать для тестирования Odoo и выполнения настроек без кода, без необходимости устанавливать Odoo локально.

Может использоваться как для тестирования Odoo, так и для долгосрочного использования.

Как и экземпляры demo, экземпляры SaaS не требуют локальной установки, достаточно веб-браузера.

С помощью инсталлятора

Odoo предоставляет упакованные инсталляторы для Windows, deb-дистрибутивы (Debian, Ubuntu, …) и RPM-дистрибутивы (Fedora, CentOS, RHEL, …) для версий Community и Enterprise.

Эти пакеты автоматически настраивают все зависимости, но могут возникнуть сложности при обновлении.

Official Community packages with all relevant dependency requirements are available on our nightly server. Both Communtiy and Enterprise packages can be downloaded from our Download page (you must to be logged in as a paying customer or partner to download the Enterprise packages).

Windows

  • Download the installer from our nightly server (Community only) or the Windows installer from the Download page (any edition)
  • Run the downloaded file

  • Accept the UAC prompt
  • Go through the various installation steps

Odoo будет автоматически запущен в конце установки.

Linux

Debian/Ubuntu

Odoo 11.0 „deb“ package currently supports Debian Stretch, Ubuntu Xenial, Ubuntu Zesty and Ubuntu Artful.

Подготовка

Odoo needs a PostgreSQL server to run properly. The default configuration for the Odoo „deb“ package is to use the PostgreSQL server on the same host as your Odoo instance. Execute the following command as root in order to install PostgreSQL server :

# apt-get install postgresql -y

In order to print PDF reports, you must install wkhtmltopdf yourself: the version of wkhtmltopdf available in debian repositories does not support headers and footers so it can not be installed automatically. The recommended version is 0.12.1 and is available on the wkhtmltopdf download page, in the archive section.

Репозиторий

Odoo S.A. provides a repository that can be used with Debian and Ubuntu distributions. It can be used to install Odoo Community Edition by executing the following commands as root:

# wget -O - https://nightly.odoo.com/odoo.key | apt-key add -
# echo "deb http://nightly.odoo.com/11.0/nightly/deb/ ./" >> /etc/apt/sources.list.d/odoo.list
# apt-get update && apt-get install odoo

You can then use the usual apt-get upgrade command to keep your installation up-to-date.

At this moment, there is no repository for the Enterprise Edition.

Deb пакеты

Instead of using the repository as described above, the „deb“ package can be downloaded here:

You can then use gdebi:

# gdebi <path_to_installation_package>

Or dpkg (handles less dependencies automatically):

# dpkg -i <path_to_installation_package> # this probably fails with missing dependencies
# apt-get install -f # should install the missing dependencies
# dpkg -i <path_to_installation_package>

Это установит Odoo в качестве службы, создаст нужного пользователя PostgreSQL и автоматически запустит сервер.

  • python3-vobject: Used in calendars to produce ical files.
  • python3-pyldap: Used to authenticat users with LDAP.
  • python3-qrcode: Used by the hardware driver for ESC/POS

If you need one or all of the packages mentioned in the above warning, you can install them manually. One way to do it, is simply using pip3 like this:

$ sudo pip3 install vobject qrcode
$ sudo apt install libldap2-dev libsasl2-dev
$ sudo pip3 install pyldap

If you need this feature, you can install the python module like this:

$ sudo pip3 install num2words

Fedora

Odoo 11.0 „rpm“ package supports Fedora 26. As of 2017, CentOS does not have the minimum Python requirements (3.5) for Odoo 11.0.

Подготовка

Odoo needs a PostgreSQL server to run properly. Assuming that the „sudo“ command is available and configured properly, run the following commands :

$ sudo dnf install -y postgresql-server
$ sudo postgresql-setup --initdb --unit postgresql
$ sudo systemctl enable postgresql
$ sudo systemctl start postgresql

In order to print PDF reports, you must install wkhtmltopdf yourself: the version of wkhtmltopdf available in Debian repositories does not support headers and footers so it is not used as a direct dependency. The recommended version is 0.12.5 and is available on the wkhtmltopdf download page, in the archive section. Previously recommended version 0.12.1 is a good alternative. More details on the various versions and their respective quirks can be found in our wiki.

Репозиторий

Odoo S.A. provides a repository that can be used with the Fedora distibutions. It can be used to install Odoo Community Edition by executing the following commands:

$ sudo dnf config-manager --add-repo=https://nightly.odoo.com/11.0/nightly/rpm/odoo.repo
$ sudo dnf install -y odoo
$ sudo systemctl enable odoo
$ sudo systemctl start odoo
RPM пакеты

Instead of using the repository as described above, the „rpm“ package can be downloaded here:

После загрузки, пакет может быть установлен с помощью пакетного менеджера [UNKNOWN NODE title_reference]:

$ sudo dnf localinstall odoo_11.0.latest.noarch.rpm
$ sudo systemctl enable odoo
$ sudo systemctl start odoo

Из исходников

The source «installation» really is about not installing Odoo, and running it directly from source instead.

Это может быть более удобным для разработчиков модулей, поскольку исходники Odoo будут расположены так, как вам нужно. Это может быть удобнее чем использование пакетной установки (для изучения исходного кода модулей или для сборки этой документации и ее доступности в автономном режиме).

запуск и остановка работы Odoo становятся более гибким и очевидными, чем службы, настроенные упакованными установками, и позволяет переопределять параметры, используя параметры командной строки без необходимости редактировать файл конфигурации.

Finally it provides greater control over the system’s set up, and allows more easily keeping (and running) multiple versions of Odoo side-by-side.

Подготовка

Source installation requires manually installing dependencies:

  • Python 3.5+.

    • on Linux and OS X, using your package manager if not installed by default

    • on Windows, use the official Python 3 installer.

  • PostgreSQL, to use a local database

    After installation you will need to create a postgres user: by default the only user is postgres, and Odoo forbids connecting as postgres.

    • on Linux, use your distribution’s package, then create a postgres user named like your login:

      $ sudo su - postgres -c "createuser -s $USER"
      

      Because the role login is the same as your unix login unix sockets can be use without a password.

    • on OS X, postgres.app is the simplest way to get started, then create a postgres user as on Linux
    • on Windows, use PostgreSQL for windows then

      • add PostgreSQL’s bin directory (default: C:\Program Files\PostgreSQL\9.4\bin) to your PATH
      • create a postgres user with a password using the pg admin gui: open pgAdminIII, double-click the server to create a connection, select Edit ‣ New Object ‣ New Login Role, enter the usename in the Role Name field (e.g. odoo), then open the Definition tab and enter the password (e.g. odoo), then click OK.

        The user and password must be passed to Odoo using either the -w and -r options or the configuration file

  • Python dependencies listed in the requirements.txt file.

    • on Linux, python dependencies may be installable with the system’s package manager or using pip.

      For libraries using native code (Pillow, lxml, greenlet, gevent, psycopg2, ldap) it may be necessary to install development tools and native dependencies before pip is able to install the dependencies themselves. These are available in -dev or -devel packages for Python, Postgres, libxml2, libxslt, libevent, libsasl2 and libldap2. Then the Python dependecies can themselves be installed:

      $ pip3 install -r requirements.txt
      
    • on OS X, you will need to install the Command Line Tools (xcode-select --install) then download and install a package manager of your choice (homebrew, macports) to install non-Python dependencies. pip can then be used to install the Python dependencies as on Linux:

      $ pip3 install -r requirements.txt
      
    • on Windows you need to install some of the dependencies manually, tweak the requirements.txt file, then run pip to install the remaning ones.

      Install psycopg using the installer here http://www.stickpeople.com/projects/python/win-psycopg/

      Then use pip to install the dependencies using the following command from a cmd.exe prompt (replace \YourOdooPath by the actual path where you downloaded Odoo):

      C:\> cd \YourOdooPath
      C:\YourOdooPath> C:\Python35\Scripts\pip.exe install -r requirements.txt
      
  • Less CSS via nodejs

    • on Linux, use your distribution’s package manager to install nodejs and npm.

      Once npm is installed, use it to install less:

      $ sudo npm install -g less
      
    • on OS X, install nodejs via your preferred package manager (homebrew, macports) then install less:

      $ sudo npm install -g less
      
    • on Windows, install nodejs, reboot (to update the PATH) and install less:

      C:\> npm install -g less
      

Установка из исходников

There are two ways to obtain the Odoo source code: zip or git.

  • Odoo zip can be downloaded from our nightly server or our Download page, the zip file then needs to be uncompressed to use its content
  • git allows simpler update and easier switching between different versions of Odoo. It also simplifies maintaining non-module patches and contributions. The primary drawback of git is that it is significantly larger than a tarball as it contains the entire history of the Odoo project.

Community Edition

The git repository is https://github.com/odoo/odoo.git for the Community edition.

Downloading it requires a git client (which may be available via your distribution on linux) and can be performed using the following command:

$ git clone https://github.com/odoo/odoo.git

Enterprise Edition

If you have access to the Enterprise repository (see Версии Odoo if you wish to get access), you can use this command to fetch the addons:

$ git clone https://github.com/odoo/enterprise.git

Запуск Odoo

Once all dependencies are set up, Odoo can be launched by running odoo-bin.

Configuration can be provided either through command-line arguments or through a configuration file.

Общие необходимые настройки:

  • PostgreSQL host, port, user and password.

    Odoo has no defaults beyond psycopg2’s defaults: connects over a UNIX socket on port 5432 with the current user and no password. By default this should work on Linux and OS X, but it will not work on windows as it does not support UNIX sockets.

  • Custom addons path beyond the defaults, to load your own modules

Under Windows a typical way to execute odoo would be:

C:\YourOdooPath> python3 odoo-bin -w odoo -r odoo --addons-path=addons -d mydb

Where odoo, odoo are the postgresql login and password and mydb the default db to serve on localhost:8069. You can add other directory paths separated by a comma to addons at the end of the addons-path option.

Under Unix a typical way to execute odoo would be:

$ ./odoo-bin --addons-path=addons -d mydb

Where mydb is the default db to serve on localhost:8069. You can add other directory paths separated by a comma to addons at the end of the addons-path option.

Virtualenv

Virtualenv is a tool to create Python isolated environments because it’s sometimes preferable to not mix your distribution python modules packages with globally installed python modules with pip.

This section will explain how to run Odoo in a such isolated Python environment.

Here we are going to use virtualenvwrapper which is a set of shell scripts that makes the use of virtualenv easier.

The examples below are based on a Debian 9 distribution but could be adapted on any platform where virtualenvwrapper and virtualenv are able to run.

This section assumes that you obtained the Odoo sources from the zip file or the git repository as explained above. The same apply for postgresql installation and configuration.

Install virtualenvwrapper

$ sudo apt install virtualenvwrapper
$ source /usr/share/virtualenvwrapper/virtualenvwrapper.sh

This will install virtualenvwrapper and activate it immediately. Now, let’s install the tools required to build Odoo dependencies if needed:

$ sudo apt install build-essential python3-dev libxslt-dev libzip-dev libldap2-dev libsasl2-dev

Create an isolated environment

Now we can create a virtual environment for Odoo like this:

$ mkvirtualenv -p /usr/bin/python3 odoo-venv

With this command, we ask for an isolated Python3 environment that will be named «odoo-env». If the command works as expected, your shell is now using this environment. Your prompt should have changed to remind you that you are using an isolated environment. You can verify with this command:

$ which python3

This command should show you the path to the Python interpreter located in the isolated environment directory.

Now let’s install the Odoo required python packages:

$ cd your_odoo_sources_path
$ pip install -r requirements.txt

After a little while, you should be ready to run odoo from the command line as explained above.

When you you want to leave the virtual environment, just issue this command:

$ deactivate

Whenever you want to work again with your „odoo-venv“ environment:

$ workon odoo-venv

Docker

The full documentation on how to use Odoo with Docker can be found on the official Odoo docker image page.