CRM — Odoo Business 0.1 documentation

安装odoo

安装Odoo的方式有很多,我们这里讲的是OpenERP.HK 在国内所遇见客户的大部分安装方式。

本文档试图描述大多数安装选项。

演示
最简单的 "安装", 只为了更快地使用系统,了解Odoo可以做什么
SaaS

由OpenERP.HK全面管理和迁移,Odoo S.A 提供Bug 修复,可用来测试Odoo,避免复杂的定制 (i.e. 自定义模块或Odoo应用商店不兼容).

可以用于测试odoo或长期的生产使用。

安装包

允许更多的灵活性,托管和部署系统和更大的控制数据存储。

适用于测试Odoo,开发模块,如需在生产环境使用,需要专业配置和维护。

源代码安装

安装包安装Packaged installers难度高一些, 但会更加灵活: 包装安装人员一般不允许多个运行Odoo版本相同的系统,并且不提供方便源接入Odoo本身。

适合于开发模块, 可以是部署测试的起点.

您可以在我们的下载界面下载最新的Odoo源代码.

docker 镜像
如果您使用 docker 来部署您的 odoo, 您可以在Docker官方网站 docker 下载源代码, 参见帮助文档获取更多信息.

版本

There are two different 版本 of Odoo: 社区版和企业版. 如果希望使用企业版,您可以到OpenERP.HK SaaS,如果需要长期使用,请联系我们的会员支持中心.

如果您已经在使用社区版,但希望迁移至企业版(OpenERP.HK中国会计版),请参见 从社区版到企业版 (except for 源代码安装).

如果你想拥有企业版源代码, 您可以:

  • 前往 下载 页,并使用您的会员登录密码登录
  • Download the source on GitHub using git_(available to partners only)

Demo

To simply get a quick idea of Odoo, 演示 instances are available. 他们是只共享几个小时的共享实例,可以用来浏览周围和尝试的事情没有承诺.

Demo instances require no local installation, just a web browser.

SaaS

OpenERP.HK的 SaaS 服务,并且可以免费开始. 并且可以用来测试Odoo,和无代码级别的高度定制化.

比如 演示demo 实例, SaaS 实例就不需要本地安装, 一个浏览器即可.

安装包安装

Odoo(OpenERP.HK)还提供了Windows, deb-based distributions (Debian, Ubuntu, …)安装包,支持社区版和企业版.

这些安装包会自动安装全部依赖 (社区版), but may be difficult to keep up-to-date.

官方社区包与所有相关的依赖要求可在我们的 nightly 服务器. Both Communtiy and Enterprise packages can be downloaded from our 下载 页 (你必须登录作为支付客户或合作伙伴下载企业包).

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 will automatically be started at the end of the installation.

Configuration

The 配置文件 can be found at %PROGRAMFILES%\Odoo 10.0-id\server\odoo.conf.

The configuration file can be edited to connect to a remote Postgresql, edit file locations or set a dbfilter.

To reload the configuration file, restart the Odoo service via Services ‣ odoo server.

Deb

Community

To install Odoo 10.0 Community on Debian-based distribution, execute the following commands as root:

# wget -O - https://nightly.odoo.com/odoo.key | apt-key add -
# echo "deb http://nightly.odoo.com/10.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.

Enterprise

For Odoo 10.0 Enterprise, get the package from the Download page. You can then use gdebi:

# apt-get install postgresql -y
# gdebi <path_to_installation_package>

Or dpkg (handles less dependencies automatically):

# apt-get install postgresql -y
# 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>

This will install Odoo as a service, create the necessary PostgreSQL user and automatically start the server.

Configuration

The configuration file can be found at /etc/odoo/odoo.conf

When the configuration file is edited, Odoo must be restarted using service:

$ sudo service odoo restart
Restarting odoo: ok

RPM

Community

Execute the following commands to install Odoo 10.0 Community on your server:

$ sudo yum install -y postgresql-server
$ sudo postgresql-setup initdb
$ sudo systemctl enable postgresql
$ sudo systemctl start postgresql
$ sudo yum install yum-utils
$ sudo yum-config-manager --add-repo=https://nightly.odoo.com/10.0/nightly/rpm/odoo.repo
$ sudo yum install -y odoo
$ sudo systemctl enable odoo
$ sudo systemctl start odoo

企业版

For Odoo 10.0 企业版, 请到 下载界面 页. Then run:

$ sudo yum install -y postgresql-server
$ sudo postgresql-setup initdb
$ sudo systemctl enable postgresql
$ sudo systemctl start postgresql
$ sudo yum localinstall odoo_10.0.latest.noarch.rpm
$ sudo systemctl enable odoo
$ sudo systemctl start odoo

Configuration

The configuration file can be found at /etc/odoo/odoo.conf

When the configuration file is edited, Odoo must be restarted via SystemD:

$ sudo systemctl restart odoo

源代码安装

源代码 "安装" 其实更准确地说是直接用源代码运行Odoo.

这可以更方便的进行模块的开发人员为Odoo源更容易访问比使用打包安装(信息或建立此文档并脱机使用).

I因此,启动和停止的odoo T是更灵活的比和显服务设置的包装和安装,允许掩盖设置使用 command-line parameters without needing to edit a configuration file.

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.

Community

There are two way to get the odoo source source zip or git.

  • Odoo zip can be downloaded from our nightly server or our 下载 页, the zip file then needs to be uncompressed to use its content
  • git 允许不同版本之间的简单更新和更容易切换Odoo(OpenERP.HK)。它还简化了维护非模块补丁和贡献.Git的主要缺点是它显著大于包,因为它包含了Odoo项目的整个历史.

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

    Downloading it requires a git 服务端 (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
    

企业版

If you have access to the Enterprise repository (see Editions if you wish to get access), you can use this command to fetch the addons:

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

If you use git, 您必须修改设置 --addons-path parameter of your launch command (init.d, custom script, configuration file, etc.). The Enterprise addons folder should be included before the default addons folder.

For example:

$ odoo-bin --addons-path=~/src/custom_modules,~/src/enterprise,~/src/odoo/addons

Installing dependencies

Source installation requires manually installing dependencies:

  • Python 2.7.

    • on Linux and OS X, included by default
    • on Windows, use the official Python 2.7.9 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"
      

      因为角色登录与UNIX登录一样,UNIX套接字可以使用没有密码.

    • 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
      • c用postgres用户密码使用PG管理GUI:开放pgadmin,双击服务器建立一个连接,选择 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.

      使用本地代码库(Pillow,lxml,绿色,Gevent,psycopg2,LDAP)可能需要安装开发工具和本机PIP之前的依赖关系是能够安装依赖关系本身。这些可在 -dev or -devel packages for Python, Postgres, libxml2, libxslt, libevent, libsasl2 and libldap2. Then the Python dependecies can themselves be installed:

      $ pip 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:

      $ pip 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 edit the requirements.txt file:

      • remove psycopg2 as you already have it.
      • remove the optional python-ldap, gevent and psutil because they require compilation.
      • add pypiwin32 because it's needed under windows.

      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:\Python27\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
      

Running 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.

Common necessary configurations are:

  • 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> python odoo-bin -w odoo -r odoo --addons-path=addons,../mymodules --db-filter=mydb$

Where odoo, odoo are the postgresql login and password, ../mymodules a directory with additional addons and mydb the default db to serve on localhost:8069

Under Unix a typical way to execute odoo would be:

$ ./odoo-bin --addons-path=addons,../mymodules --db-filter=mydb$

Where ../mymodules is a directory with additional addons and mydb the default db to serve on localhost:8069