博客为日常工作学习积累总结:

1.odoo12学习

参考博客:https://alanhou.org/centos-odoo-12/

CentOS 7快速安装配置 Odoo 12

添加新用户必做,不然文件权限odoo用户五权限
      useradd -m -U -r -d /opt/odoo -s /bin/bash odoo
设置密码:    passwd odoo

不设置执行后述操作时会报出xxx is not in the sudoers file. This incident will be reported.
su - root
visudo
# 在root    ALL=(ALL)       ALL下添加相应用户
odoo    ALL=(ALL)       ALL

进入odoo用户:su - odoo
    sudo yum -y update
    sudo yum -y install epel-release

这一步我用的是我现有的python环境略过了博客上的按照方法

start
# 添加Software Collections (SCL) 安装 Python
sudo yum -y install centos-release-scl
sudo yum -y install rh-python36
# 或直接执行(可能需要提前执行yum -y groupinstall "Development tools")
sudo yum -y install python36 python36-devel
# 又或者
curl -O https://www.python.org/ftp/python/3.6.7/Python-3.6.7rc2.tgz
tar xf Python-3.6.7rc2.tgz
cd Python-3.6.7rc2
./configure
make
sudo make install
# 安装其它所需依赖

end

sudo yum -y install git gcc wget nodejs-less libxslt-devel bzip2-devel openldap-devel libjpeg-devel freetype-devel

补充:更新国内 yum 源
sudo yum install wget -y
sudo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo_bak
sudo wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
sudo yum makecache

安装和配置 PostgreSQL
sudo yum install https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm
sudo yum install postgresql10 postgresql10-server -y

# 初始化
sudo /usr/pgsql-10/bin/postgresql-10-setup initdb
# 启动服务
sudo systemctl enable postgresql-10
sudo systemctl start postgresql-10
# 创建用户(可任选名称,与前面创建的系统用户名需相同)
sudo su - postgres -c "createuser -s odoo"

ALTER USER odoo WITH PASSWORD '123456'

配置远程访问数据库
修改postgres数据库管理员密码:

su - postgres 切换用户,执行后提示符会变为 ‘-bash-4.2$’,切换为UNIX风格的bash
psql -U postgres 登录数据库,执行后提示符变为 ‘postgres=#’
ALTER USER postgres WITH PASSWORD ‘123456’ 设置postgres用户密码
\q 退出数据库

切换到root配置一下远程连接。
开启远程访问

vi /var/lib/pgsql/10/data/postgresql.conf
修改
#listen_addresses = ‘localhost’

listen_addresses=’ *’
当然,此处‘ *’也可以改为任何你想开放的服务器IP

信任远程连接

vi /var/lib/pgsql/10/data/pg_hba.conf
修改如下内容,信任指定服务器连接
# IPv4 local connections:
host all all 127.0.0.1/32 trust
host all all 0.0.0.0/0 trust
host all all 192.168.1.2/32 trust

我的系统已经关闭防火墙:略过

start
远程连接配置完成,由于系统原因,还需要在防火墙中打开相应的端口。

打开防火墙
CentOS 防火墙中内置了PostgreSQL服务,配置文件位置在 ,我们只需以服务方式将PostgreSQL服务开放即可。

sudo firewall-cmd --permanent --zone=public --add-port=5432/tcp
sudo firewall-cmd --reload

查看配置文件地址

查看当前配置文件地址,修改配置文件,是该用户可以通过远程(navicate)连接数据库

查看配置文件路径

select name,setting from pg_settings where category='File Locations';

end

systemctl restart postgresql-10.service

安装Wkhtmltopdf
wget https://downloads.wkhtmltopdf.org/0.12/0.12.5/wkhtmltox-0.12.5-1.centos7.x86_64.rpm
sudo yum localinstall wkhtmltox-0.12.5-1.centos7.x86_64.rpm -y
# 中文字体
sudo yum install -y wqy*

安装Sass
sudo yum install -y sassc

安装 Odoo

安装及配置
# 切换用户
sudo su - odoo
cd /opt/odoo
wget http://nightly.odoo.com/12.0/nightly/src/odoo_12.0.latest.tar.gz
# 或git clone https://www.github.com/odoo/odoo --depth 1 --branch 12.0 /opt/odoo/odoo12   (我使用git拉取代码)
tar -zxvf odoo_12.0.latest.tar.gz
mv odoo-12.0.post20181019/ odoo12

我的Python环境这一步不需要做
# 当前使用 nightly 版本有一个坑,需要自行添加 odoo-bin 文件
#!/usr/bin/env python3

# set server timezone in UTC before time module imported
__import__('os').environ['TZ'] = 'UTC'
import odoo

if __name__ == "__main__":
    odoo.cli.main()
#添加执行权限   由于我的环境按照jdk python是用的root权限因此odoo会没有权限访问python3
chmod +x odoo12/odoo-bin
chown -R odoo:odoo /opt
chown -R odoo:odoo /application
#环境搭建
python -m venv odoo12-venv
source odoo12-venv/bin/activate

# 或者 Virtualenvwrapper(使用这种方法/etc/systemd/system/odoo12.service也需调整)
curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
python36 get-pip.py
pip3 install virtualenvwrapper
# vi ~/.bashrc
export WORKON_HOME=/opt/virtualenvs
# export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python36
source /usr/bin/virtualenvwrapper.sh
#重载.bashrc
source  ~/.bashrc

# 安装依赖包
pip3 install -i https://pypi.douban.com/simple -r odoo12/requirements.txt
deactivate

# 创建自定义插件目录,如果使用 Git 建议将 local-addons 放在与 odoo12同一级
mkdir odoo12/local-addons

# 创建配置文件(<a href="https://www.jianshu.com/p/abf366d7319e" target="_blank" rel="noopener" data-mce-href="https://www.jianshu.com/p/abf366d7319e">配置项详解参考</a>)
# odoo12/odoo-bin --help也可进行查看
sudo vi /etc/odoo12.conf

[options]
; This is the password that allows database operations:
# 此处密码请自行修改
admin_passwd = superadmin_passwd
db_host = False
db_port = False
db_user = odoo
db_password = False
; addons_path = /opt/odoo/odoo12/odoo/addons
; If you are using custom modules
addons_path = /opt/odoo/odoo12/addons,/opt/odoo/odoo12/local-addons

# 切换用户
sudo su - odoo
cd /opt/odoo
wget http://nightly.odoo.com/12.0/nightly/src/odoo_12.0.latest.tar.gz
# 或git clone https://www.github.com/odoo/odoo --depth 1 --branch 12.0 /opt/odoo/odoo12
tar -zxvf odoo_12.0.latest.tar.gz
mv odoo-12.0.post20181019/ odoo12
 
# 当前使用 nightly 版本有一个坑,需要自行添加 odoo-bin 文件
#!/usr/bin/env python3
 
# set server timezone in UTC before time module imported
__import__('os').environ['TZ'] = 'UTC'
import odoo
 
if __name__ == "__main__":
    odoo.cli.main()
#添加执行权限
chmod +x odoo12/odoo-bin
#环境搭建
python36 -m venv odoo12-venv
source odoo12-venv/bin/activate
 
# 或者 Virtualenvwrapper(使用这种方法/etc/systemd/system/odoo12.service也需调整)
curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
python36 get-pip.py
pip3 install virtualenvwrapper
# vi ~/.bashrc
export WORKON_HOME=/opt/virtualenvs
# export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python36
source /usr/bin/virtualenvwrapper.sh
#重载.bashrc
source  ~/.bashrc
 
# 安装依赖包
pip3 install -i https://pypi.douban.com/simple -r odoo12/requirements.txt
deactivate
 
# 创建自定义插件目录,如果使用 Git 建议将 local-addons 放在与 odoo12同一级
mkdir odoo12/local-addons
 
# 创建配置文件(<a href="https://www.jianshu.com/p/abf366d7319e" target="_blank" rel="noopener" data-mce-href="https://www.jianshu.com/p/abf366d7319e">配置项详解参考</a>)
# odoo12/odoo-bin --help也可进行查看
sudo vi /etc/odoo12.conf
 
[options]
; This is the password that allows database operations:
# 此处密码请自行修改
admin_passwd = superadmin_passwd
db_host = False
db_port = False
db_user = odoo
db_password = False
; addons_path = /opt/odoo/odoo12/odoo/addons
; If you are using custom modules
addons_path = /opt/odoo/odoo12/odoo/addons,/opt/odoo/odoo12/local-addons

添加服务
sudo vi /etc/systemd/system/odoo12.service

[Unit]
Description=Odoo12
Requires=postgresql-10.service
After=network.target postgresql-10.service

[Service]
Type=simple
SyslogIdentifier=odoo12
PermissionsStartOnly=true
User=odoo
Group=odoo
WorkingDirectory=/opt/odoo
Environment=/opt/odoo/odoo12-venv/bin/activate
ExecStart=/opt/odoo/odoo12-venv/bin/python3 /opt/odoo/odoo12/odoo-bin -c /etc/odoo12.conf
# ExecStart=/usr/bin/scl enable rh-python36 -- /opt/odoo/odoo12-venv/bin/python3 /opt/odoo/odoo12/odoo-bin -c /etc/odoo12.conf
StandardOutput=journal+console

[Install]
WantedBy=multi-user.target

# 启动服务
sudo systemctl daemon-reload
sudo systemctl start odoo12
sudo systemctl enable odoo12

sudo vi /etc/systemd/system/odoo12.service
 
[Unit]
Description=Odoo12
Requires=postgresql-10.service
After=network.target postgresql-10.service
 
[Service]
Type=simple
SyslogIdentifier=odoo12
PermissionsStartOnly=true
User=odoo
Group=odoo
WorkingDirectory=/opt/odoo
Environment=/opt/odoo/odoo12-venv/bin/activate
ExecStart=/opt/odoo/odoo12-venv/bin/python3 /opt/odoo/odoo12/odoo-bin -c /etc/odoo12.conf
# ExecStart=/usr/bin/scl enable rh-python36 -- /opt/odoo/odoo12-venv/bin/python /opt/odoo/odoo12/odoo-bin -c /etc/odoo12.conf
StandardOutput=journal+console
 
[Install]
WantedBy=multi-user.target
 
# 启动服务
sudo systemctl daemon-reload
sudo systemctl start odoo12

示例配置文件
[options]
addons_path = /usr/lib/python3/dist-packages/odoo/addons
admin_passwd = $pbkdf2-sha512$25000$y9k7Z4zROifEOOf8v5fSeg$WD0vlcapmdkyCY8Uy9Md/Z1kchm8Sj942E4B1Ry13iwcCKaRFf1t3DEPYQrsB6iPwb2K/kJ6obs9CX2HRsx9KA
csv_internal_sep = ,
data_dir = /var/lib/odoo/.local/share/Odoo
db_host = False
db_maxconn = 64
db_name = False
db_password = False
db_port = False
db_sslmode = prefer
db_template = template0
db_user = odoo
dbfilter =
demo = {}
email_from = False
geoip_database = /usr/share/GeoIP/GeoLite2-City.mmdb
http_enable = True
http_interface =
http_port = 8069
import_partial =
limit_memory_hard = 2684354560
limit_memory_soft = 2147483648
limit_request = 8192
limit_time_cpu = 60
limit_time_real = 120
limit_time_real_cron = -1
list_db = True
log_db = False
log_db_level = warning
log_handler = :INFO
log_level = info
logfile = /var/log/odoo/odoo-server.log
logrotate = False
longpolling_port = 8072
max_cron_threads = 2
osv_memory_age_limit = 1.0
osv_memory_count_limit = False
pg_path = None
pidfile = None
proxy_mode = False
reportgz = False
server_wide_modules = base,web
smtp_password = False
smtp_port = 25
smtp_server = localhost
smtp_ssl = False
smtp_user = False
syslog = False
test_enable = False
test_file = False
test_tags = None
translate_modules = ['all']
unaccent = False
without_demo = False
workers = 0

[options]
addons_path = /usr/lib/python3/dist-packages/odoo/addons
admin_passwd = $pbkdf2-sha512$25000$y9k7Z4zROifEOOf8v5fSeg$WD0vlcapmdkyCY8Uy9Md/Z1kchm8Sj942E4B1Ry13iwcCKaRFf1t3DEPYQrsB6iPwb2K/kJ6obs9CX2HRsx9KA
csv_internal_sep = ,
data_dir = /var/lib/odoo/.local/share/Odoo
db_host = False
db_maxconn = 64
db_name = False
db_password = False
db_port = False
db_sslmode = prefer
db_template = template0
db_user = odoo
dbfilter =
demo = {}
email_from = False
geoip_database = /usr/share/GeoIP/GeoLite2-City.mmdb
http_enable = True
http_interface =
http_port = 8069
import_partial =
limit_memory_hard = 2684354560
limit_memory_soft = 2147483648
limit_request = 8192
limit_time_cpu = 60
limit_time_real = 120
limit_time_real_cron = -1
list_db = True
log_db = False
log_db_level = warning
log_handler = :INFO
log_level = info
logfile = /var/log/odoo/odoo-server.log
logrotate = False
longpolling_port = 8072
max_cron_threads = 2
osv_memory_age_limit = 1.0
osv_memory_count_limit = False
pg_path = None
pidfile = None
proxy_mode = False
reportgz = False
server_wide_modules = base,web
smtp_password = False
smtp_port = 25
smtp_server = localhost
smtp_ssl = False
smtp_user = False
syslog = False
test_enable = False
test_file = False
test_tags = None
translate_modules = ['all']
unaccent = False
without_demo = False
workers = 0

2.整合邮箱:

mail.from=messenger.system@honortone.com
mail.fromname=system messenger
mail.host=smtp.honortone.com
mail.password=be587446
mail.smtp.auth=true
mail.smtp.timeout=25000
mail.username=messenger.system@honortone.com

smtp_password = be587446
smtp_port = 25
smtp_server = smtp.honortone.com
smtp_ssl = False
smtp_user = messenger.system@honortone.com
email_from = messenger.system@honortone.com

3..整合微信:可参考代码发布,哈哈
mkdir /opt/odoo/odoo12/local-addons/oejia_wx
git clone https://www.github.com/JoneXiong/oejia_wx/ --depth 1 --branch 12.0 /opt/odoo/odoo12/local-addons/oejia_wx

4..整合国外的muk_web:可参考代码发布,哈哈
mkdir /opt/odoo/odoo12/local-addons/muk_web
git clone https://github.com/muk-it/muk_web --depth 1 --branch 12.0 /opt/odoo/odoo12/local-addons/muk_web

5.整合国外的auto_backup自动备份:可参考代码发布,哈哈
mkdir /opt/odoo/odoo12/local-addons/auto_backup
git clone https://github.com/Yenthe666/auto_backup --depth 1 --branch 12.0 /opt/odoo/odoo12/local-addons/auto_backup

pip3 install -i https://pypi.douban.com/simple -r odoo12/local-addons/auto_backup/requirements.txt

6.整合国外的addons-onestein
可参考代码发布,哈哈
mkdir /opt/odoo/odoo12/local-addons/addons-onestein

git clone https://github.com/aliensoftwaredev/Odoo --depth 1 --branch 12.0 /opt/odoo/odoo12/local-addons/addons-onestein

7.整合国外的aliensoftwaredev:可参考代码发布,哈哈
mkdir /opt/odoo/odoo12/local-addons/aliensoftwaredev
git clone https://github.com/aliensoftwaredev/Odoo --depth 1 --branch 12.0 /opt/odoo/odoo12/local-addons/aliensoftwaredev

8.整合国内的oejia_weshop:可参考代码发布,哈哈
mkdir /opt/odoo/odoo12/local-addons/oejia_weshop
git clone https://github.com/JoneXiong/oejia_weshop --depth 1 --branch 12.0 /opt/odoo/odoo12/local-addons/oejia_weshop

pip3 install -i https://pypi.douban.com/simple -r /opt/odoo/odoo12/local-addons/oejia_weshop/requirements.txt

9.整合国内的oejia_menu:可参考代码发布,哈哈
mkdir /opt/odoo/odoo12/local-addons/oejia_menu
git clone https://github.com/JoneXiong/oejia_menu --depth 1 --branch 12.0 /opt/odoo/odoo12/local-addons/oejia_menu

10.整合国内的oejia_weshop:可参考代码发布,哈哈
mkdir /opt/odoo/odoo12/local-addons/weodoo
git clone https://github.com/JoneXiong/weodoo --depth 1 --branch master /opt/odoo/odoo12/local-addons/weodoo

https://github.com/OmniaGit/odooplm
10.整合国内的odooplm:可参考代码发布,哈哈
mkdir /opt/odoo/odoo12/local-addons/odooplm
git clone https://github.com/OmniaGit/odooplm --depth 1 --branch 12.0 /opt/odoo/odoo12/local-addons/odooplm

7.整合国外的theme_nice_bootstrap-12.0.1.0.zip

unzip theme_nice_bootstrap-12.0.1.0.zip

8.整合国外的asset_documents-12.0.1.0.0.zip
unzip asset_documents-12.0.1.0.0.zip

9.整合国外的backend_theme_v12-12.0.0.1.zip
unzip backend_theme_v12-12.0.0.1.zip

05.odoo12开源框架学习的更多相关文章

  1. 28款GitHub最流行的开源机器学习项目,推荐GitHub上10 个开源深度学习框架

    20 个顶尖的 Python 机器学习开源项目 机器学习 2015-06-08 22:44:30 发布 您的评价: 0.0 收藏 1收藏 我们在Github上的贡献者和提交者之中检查了用Python语 ...

  2. iOS超全开源框架、项目和学习资料汇总(5)AppleWatch、经典博客、三方开源总结篇

    完整项目 v2ex – v2ex 的客户端,新闻.论坛.apps-ios-wikipedia – apps-ios-wikipedia 客户端.jetstream-ios – 一款 Uber 的 MV ...

  3. SunSonic 3.0 ORM开源框架的学习

    SubSonic 3.0简介 接触到SubSonic3.0 ORM框架是看了AllEmpty大神的从零开始编写自己的C#框架(链接在此)系列的随笔接触到的,本文章学习内容源于AllEmpty大神. S ...

  4. 【转】iOS超全开源框架、项目和学习资料汇总

    iOS超全开源框架.项目和学习资料汇总(1)UI篇iOS超全开源框架.项目和学习资料汇总(2)动画篇iOS超全开源框架.项目和学习资料汇总(3)网络和Model篇iOS超全开源框架.项目和学习资料汇总 ...

  5. Android 学习笔记之Volley开源框架解析(一)

    PS:看完了LGD的六场比赛...让人心酸... 学习内容: 1.Http请求的过程... 2.Volley的简单介绍...   1.Http请求...   这里只是简单的说一下Http请求的过程.. ...

  6. 推荐GitHub上10 个开源深度学习框架

    推荐GitHub上10 个开源深度学习框架   日前,Google 开源了 TensorFlow(GitHub),此举在深度学习领域影响巨大,因为 Google 在人工智能领域的研发成绩斐然,有着雄厚 ...

  7. 值得学习的C/C++开源框架(转)

    值得学习的C语言开源项目 - 1. Webbench Webbench是一个在linux下使用的非常简单的网站压测工具.它使用fork()模拟多个客户端同时访问我们设定的URL,测试网站在压力下工作的 ...

  8. iOS超全开源框架、项目和学习资料汇总--数据库、缓存处理、图像浏览、摄像照相视频音频篇

    iOS超全开源框架.项目和学习资料汇总--数据库.缓存处理.图像浏览.摄像照相视频音频篇 感谢:Ming_en_long 的分享 大神超赞的集合,http://www.jianshu.com/p/f3 ...

  9. ArXiv最受欢迎开源深度学习框架榜单:TensorFlow第一,PyTorch第四

    [导读]Kears作者François Chollet刚刚在Twitter贴出最近三个月在arXiv提到的深度学习框架,TensorFlow不出意外排名第一,Keras排名第二.随后是Caffe.Py ...

随机推荐

  1. Python爬虫教程-26-Selenium + PhantomJS

    Python爬虫教程-26-Selenium + PhantomJS 动态前端页面 : JavaScript: JavaScript一种直译式脚本语言,是一种动态类型.弱类型.基于原型的语言,内置支持 ...

  2. ArcGIS 10.1 如何连接数据库(转载)

    ArcGIS 10.1如何连接数据库 最近在使用ArcGIS 10.1的数据库,在使用的过程中发现了跟以往不太一样的地方,在这里将自己的心得和想法跟大家分享一下(使用Postgresql),根据使用过 ...

  3. .net CombinedGeometry的合并模式

    <Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="h ...

  4. DELPHI SOKET 编程--使用TServerSocket和TClientSocket

    本文采用delphi7+TServerSocket+TClientSocket; 笔者在工作中遇到对局域网中各工作站与服务器之间进行Socket通信的问题.现在将本人总结出来的TServerSocke ...

  5. POI读取xls和xlsx

    import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import  ...

  6. 用java读取多种文件格式的文件(pdf,pptx,ppt,doc,docx..)

    本文通过开源pdfbox和poi进行处理多种文件格式的文本读入 1.需要的jar的maven坐标: <dependency> <groupId>org.apache.pdfbo ...

  7. C++ 类的存储方式以及虚函数表

    一.C++成员函数在内存中的存储方式 用类去定义对象时,系统会为每一个对象分配存储空间.如果一个类包括了数据和函数,要分别为数据和函数的代码分配存储空间.按理说,如果用同一个类定义了10个对象,那么就 ...

  8. sql 获取每个分组的前N条记录的写法

    SELECT * FROM ( --根据 tb表的name进行分组,根据年龄排序 SELECT * , ROW_NUMBER() OVER ( PARTITION BY name ORDER BY a ...

  9. canvas的两个方法说明

    今天在用canvas的时候,发现有两个方法比较陌生,在此记录详细说明一下. (1)文本绘制的一个方法 canvas.drawTextOnPath(text, path, hOffset, vOffse ...

  10. django 静态文件

    django 1.8版本以上 django 静态文件配置. 小作之前, 一直觉得django的静态文件配置非常的麻烦. 1. 要设置url(r'^static/(?P<path>.*)&a ...