赞
踩
目录
5、创建一个工作文件夹work17,并且在work17里面创建一个存放odoo源代码的文件odoo17
7、在work17文件下面创建work17/log/odoo.log文件用来存放日志信息
8、在etc/下面创建一个odoo17的配置文件odoo17.conf,写入odoo源代码的模块路径以及自己开发代码的路径
9、在etc/systemd/system/odoo17.service创建odoo17.service文件
11、在work17文件中创建python虚拟环境用来存放python环境
12、将python环境添加到etc/systemd/system/odoo17.service配置文件中
13、如果你是在一个开发环境中存在16和17的开发环境,并且你按照上述配置好odoo17
14、重启完你会发现你的启动服务项还是以前的odoo16,这时你需要修改启动项
sudo apt-get update
sudo apt-get install openssh-server fail2ban
sudo apt-get install -y python3-pip
sudo apt-get install python-dev python3-dev libxml2-dev libxslt1-dev zlib1g-dev libsasl2-dev libldap2-dev build-essential libssl-dev libffi-dev libmysqlclient-dev libjpeg-dev libpq-dev libjpeg8-dev liblcms2-dev libblas-dev libatlas-base-dev
sudo apt-get install postgresql
sudo su - postgres
# 创建odoo用户,尽量不要使用最高管理员来跑odoo服务
createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt odoo17
sudo adduser --system --home=/opt/odoo --group odoo
mkdir work17
mkdir work17/odoo17
sudo apt-get install git
cd work17/odoo17
git clone https://www.github.com/odoo/odoo --depth 1 --branch master --single-branch .
mkdir work17/log
cd work17/log/
touch odoo.log
[options]
admin_passwd = admin
db_host = False
db_port = False
db_user = odoo17
db_password = False
addons_path = ~/work17/odoo17/addons,后面加上自己开发的文件路径
logfile = ~/work17/log/odoo.log
参数说明:
sudo vim /etc/systemd/system/odoo17.service
[Unit]
Description=Odoo
Documentation=http://www.odoo.com
[Service]
# Ubuntu/Debian convention:
Type=simple
User=odoo
ExecStart=~/worl17/odoo17/odoo-bin -c /etc/odoo17.conf
[Install]
WantedBy=default.target
python3 -m venv odoo17-venv
source odoo17-venv/bin/activate
pip3 install wheel
pip3 install -r odoo 17/requirements.txt
[Unit]
Description=Odoo
Documentation=http://www.odoo.com
[Service]
# Ubuntu/Debian convention:
Type=simple
User=odoo
ExecStart=~/work17/odoo17-venv/bin/python ~/worl17/odoo17/odoo-bin -c /etc/odoo17.conf
[Install]
WantedBy=default.target
reboot
sudo systemctl disable odoo16
sudo systemctl enable odoo17
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。