1.更新ubuntu16.04
sudo apt update && sudo apt upgrade
2.安装数据库(PostgreSQL)及系统需要的相关依赖项
sudo apt install git python-pip postgresql postgresql-server-dev-9.5 python-all-dev python-dev python-setuptools libxml2-dev libxslt1-dev libevent-dev libsasl2-dev libldap2-dev pkg-config libtiff5-dev libjpeg8-dev libjpeg-dev zlib1g-dev libfreetype6-dev liblcms2-dev liblcms2-utils libwebp-dev tcl8.6-dev tk8.6-dev python-tk libyaml-dev fontconfig
3. 建立数据库用户
3.1切换到postgres用户
sudo su - postgres
3.2建立数据库的用户(强密码)
sudo adduser --system --home=/opt/odoo --group odoo
3.3 退出postgres对话
CTRL+D
4.安装odoo10
sudo git clone https://www.github.com/odoo/odoo --depth 1 --branch 10.0 --single-branch /opt/odoo
5.安装odoo10的依赖项
sudo pip install -r /opt/odoo/doc/requirements.txt
sudo pip install -r /opt/odoo/requirements.txt
6.安装Less CSS
sudo apt-get install python-software-properties
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt install -y nodejs
sudo npm install -g less less-plugin-clean-css
7.安装Wkhtmltopdf(odoo打印需要),版本0.12.1,不建议用更高版本
cd /tmp
sudo wget https://downloads.wkhtmltopdf.org/0.12/0.12.1/wkhtmltox-0.12.1_linux-trusty-amd64.deb
sudo cp /usr/local/bin/wkhtmltopdf /usr/bin
sudo cp /usr/local/bin/wkhtmltoimage /usr/bin
8.配置odoo服务
sudo cp /opt/odoo/debian/odoo.conf /etc/odoo-server.conf
修改文件
sudo nano /etc/odoo-server.conf
admin_passwd为数据库密码
9.配置odoo服务
sudo nano /lib/systemd/system/odoo-server.service
10.设置文件权限
sudo chmod 755 /lib/systemd/system/odoo-server.service
sudo chown root: /lib/systemd/system/odoo-server.service
sudo chown -R odoo: /opt/odoo/
sudo chown odoo: /etc/odoo-server.conf
sudo chmod 640 /etc/odoo-server.conf
sudo systemctl enable odoo-server
11.至此ODOO可以通过浏览器访问使用
127.0.0.1:8069