从 http://nightly.odoo.com/10.0/nightly/src/odoo_10.0.latest.tar.gz
tar -zxvf odoo_10.0.latest.tar.gz解压
sudo apt-get update
sudo apt-get upgrade
sudo adduser –system –home=/opt/odoo –group odoo
mkdir /opt/odoo/odoo-10
cd /opt/odoo/odoo-10
sudo apt-get install postgresql 安装数据库
用postgres数据库的超级用户,创建数据库用户odoo,输入密码:123456
sudo -u postgres createuser –createdb –no-createrole –no-superuser –pwprompt odoo
odoo源码目录下的 requirements.txt 文件里面列出了 odoo-10 依赖的所有 Python lib.
因为lxml ldap psycopg2 需要使用gcc进行编译,所以,需要先安装开发相关的库 libxml2, libxslt, libpq-dev, libldap2-dev, libsasl2-dev,还有libjpeg和zlib
使用命令下面的命令安装开发库
sudo apt-get install libxml2 libxslt-dev libpq-dev libldap2-dev libsasl2-dev
sudo apt-get install libjpeg-dev zlib1g-dev
接着安装 pip
sudo apt-get install python-pip
使用 pip 安装 odoo-10 依赖的Python 库
sudo pip install -r /opt/odoo/odoo-10/requirements.txt
因为官方的npm镜像无法正常访问,必须访问国内的镜像,而国内的npm镜像太新,所以需要使用较新版本的nodejs
安装node.js NPM 以及 less
sudo apt-get install nodejs node-less npm
使用 npm 安装 less-plugin-clean-css
sudo npm install -g less-plugin-clean-css
[options]
; This is the password that allows database operations:
admin_passwd = admin
db_host = 127.0.0.1
db_port = 5432
db_user = odoo
db_password = 123456
log_level = warn
addons_path =/opt/odoo/odoo-10/odoo/addons
auto_reload = True
;workers = 2
安装:apt-get install libfontconfig1
ln -s /opt/wkhtmltox/bin/wkhtmltopdf /usr/bin/wkhtmltopdf
拷贝 /opt/odoo/odoo-10/setup/odoo 到 /opt/odoo/odoo-10/ 并命名为 odoo-bin .
为它加 可执行权限 sudo chmod +x /opt/odoo/odoo-10/odoo-bin
vim /etc/init.d/odoo
. /lib/lsb/init-functions
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/opt/wkhtmltox/bin
DAEMON=/opt/odoo/odoo-10/odoo-bin
NAME=odoo
DESC=odoo
CONFIG=/opt/odoo/odoo.conf
LOGFILE=/var/log/odoo/odoo-server.log
PIDFILE=/var/run/ NAME.pidUSER=odooexportLOGNAME= USER
test -x $DAEMON || exit 0
set -e
function _start() {
start-stop-daemon –start –quiet –pidfile PIDFILE−−chuid USER: USER−−background−−make−pidfile−−exec DAEMON – –config CONFIG−−logfile LOGFILE
}
function _stop() {
start-stop-daemon –stop –quiet –pidfile PIDFILE–oknodo–retry3rm−f PIDFILE
}
function _status() {
start-stop-daemon –status –quiet –pidfile PIDFILEreturn ?
}
case “ 1”instart)echo−n“Starting DESC: ”
_start
echo “ok”
;;
stop)
echo -n “Stopping DESC:”stopecho“ok”;;restart|force−reload)echo−n“Restarting DESC: ”
_stop
sleep 1
_start
echo “ok”
;;
status)
echo -n “Status of DESC: ”
_status && echo “running” || echo “stopped”
;;
*)
N=/etc/init.d/NAME
echo “Usage: $N {start|stop|restart|force-reload|status}” >&2
exit 1
;;
esac
exit 0
chmod +x /etc/init.d/odoo 改启动脚本的权限
sudo update-rc.d odoo defaults 开启启动自动运行 odoo服务
service odoo start[restart|stop]