关注领域建模

追随UML,学会思考

CentOS 7安装odoo 15

想管理本部门的物品和库房,决定采用仓库软件来管理,开源的好像没有看到比较简单的,最后选择odoo和axelor来对比,发现后者在中国比较少,不支持中文,于是放弃。(axelor docker安装比较简单。)

odoo是ERP软件,两年前安装过,今日再次安装,赶紧记录下来。装了两次:1,昨天网上找到centos 7安装odoo14(知乎上有兄弟专门介绍);2,今日开始结合多篇文章,安装odoo15.

更新系统:

 yum update -y

 yum install -y epel-release

安装python39: 有点困难的地方

sudo yum install gcc gcc-c++ openssl-devel bzip2-devel libffi-devel libxml2-devel libxslt-devel libjpeg-turbo-devel openldap-devel -y

 wget https://www.python.org/ftp/python/3.9.9/Python-3.9.9.tgz
 yum install -y wget

 tar xzf Python-3.9.9.tgz
 cd Python-3.9.9
 ./configure --enable-optimizations
 sudo make altinstall 
 python3.9 -V

创建用户:

sudo useradd -m -U -r -d /opt/odoo -s /bin/bash odoo
sudo yum install git gcc wget nodejs libxslt-devel bzip2-devel openldap-devel libjpeg-devel freetype-devel

安装数据库:

 sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
 yum list postgresql
 sudo yum install -y postgresql14-server
 sudo /usr/pgsql-14/bin/postgresql-14-setup initdb
 sudo systemctl enable postgresql-14
 sudo systemctl start postgresql-14
 sudo systemctl status postgresql-14
 sudo su - postgres -c "createuser -s odoo"

 sudo wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox-0.12.5-1.centos7.x86_64.rpm
 sudo yum localinstall wkhtmltox-0.12.5-1.centos7.x86_64.rpm

安装ODOO15:

sudo su - odoo

git clone https://github.com/odoo/odoo.git --depth 1 --branch 15.0 /opt/odoo/odoo15

发现3小时没有动静,ctrl + c后再来就好了。

 cd /opt/odoo
 python3.9 -m venv odoo15-venv
 source odoo15-venv/bin/activate
 pip3 install -r odoo15/requirements.txt
 /opt/odoo/odoo15-venv/bin/python3.9 -m pip install --upgrade pip 上一步出错后需要更新一下pip
 pip3 install -r odoo15/requirements.txt 再来会报以下错:Error: pg_config executable not found.

 转到root然后执行:yum install postgresql postgresql-devel python-devel

 deactivate && exit


sudo mkdir /opt/odoo/odoo15-custom-addons
udo chown odoo: /opt/odoo/odoo15-custom-addons
sudo mkdir /var/log/odoo15
sudo touch /var/log/odoo15/odoo.log
sudo chown -R odoo: /var/log/odoo15/
vi /etc/odoo.conf

[options]
; This is the password that allows database operations:
admin_passwd = passwd
db_host = False
db_port = False
db_user = odoo
db_password = False
xmlrpc_port = 8069
; longpolling_port = 8072
logfile = /var/log/odoo15/odoo.log
logrotate = True
addons_path = /opt/odoo/odoo15/addons,/opt/odoo/odoo15-custom-addons

sudo chown odoo:odoo /etc/odoo.conf

sudo chmod 640 /etc/odoo.conf
 

vi /etc/systemd/system/odoo15.service

[Unit]
Description=Odoo15
Requires=postgresql-14.service
After=network.target postgresql-14.service
[Service]
Type=simple
SyslogIdentifier=odoo15
PermissionsStartOnly=true
User=odoo
Group=odoo
ExecStart=/opt/odoo/odoo15-venv/bin/python3.9 /opt/odoo/odoo15/odoo-bin -c /etc/odoo.conf
StandardOutput=journal+console
[Install]
WantedBy=multi-user.target

 sudo systemctl daemon-reload
 sudo systemctl start odoo15.service
 sudo systemctl enable odoo15.service
 sudo systemctl status odoo15.service

IP:8069

最后就能看到界面了。

posted on 2022-01-06 16:29  Beewolf  阅读(1123)  评论(0编辑  收藏  举报

导航