odoo12.0 在Ubutu 18.04下环境的搭建
sudo apt-get update
sudo apt-get install git python3.6 postgresql nano virtualenv gcc python3.6-dev libxml2-dev libxslt1-dev
libevent-dev libsasl2-dev libldap2-dev libpq-dev libpng-dev libjpeg-dev node-less node-clean-css xfonts-75dpi xfonts-base wget xz-utils
wget -O wkhtmltox.tar.xz https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
tar xvf wkhtmltox.tar.xz
mv wkhtmltox/lib/* /usr/local/lib/
mv wkhtmltox/bin/* /usr/local/bin/
mv wkhtmltox/share/man/man1 /usr/local/share/man/
sudo adduser odoo //这里要设置odoo用户登录Ubuntu系统时对应的登录密码 odoo12.0@12345678
vim /etc/sudoers
修改文件内容:
找到root ALL=(ALL) ALL一行,
在下面插入新的一行,内容是:
odoo ALL=(ALL) ALL
然后在vim键入命令“x!”强制保存并退出。
注:这个文件是只读的,不加“!”保存会失败
sudo -u postgres createuser odoo
sudo su postgres
psql
alter user odoo with createdb; //这里是给odoo用户在postgres数据库中授权 允许创建数据库 否则odoo报权限错误
mkdir odoo-prod
cd odoo-prod
wget https://github.com/odoo/odoo/archive/12.0.zip
unzip 12.0.zip
virtualenv -p python3 env-odoo-12.0
source env-odoo-12.0/bin/activate
pip3 install -r odoo-12.0/requirements.txt
创建快捷启动可执行文件
vim statrt-odoo12.0
具体内容如下:
#! /bin/sh PYTHON=/home/odoo/odoo-prod/env-odoo-12.0/bin/python3 ODOO=/home/odoo/odoo-prod/odoo-bin CONF=/home/odoo/odoo-prod/production-12.conf ${PYTHON} ${ODOO} -c ${CONF} "$@"
添加执行权限
chmod +x start-odoo12.0
创建production-12.conf文件
vim production-12.conf
具体内容如下
[options] addons_path = /home/odoo/odoo-prod/odoo-12.0/odoo/addons,/home/odoo/odoo-prod/odoo-12.0/addons admin_passwd = odoo12.0@7867 csv_internal_sep = , data_dir = /home/odoo/odoo-prod/data-12.0 db_host = False db_maxconn = 64 db_name = False db_password = False db_port = False db_sslmode = prefer db_template = template1 db_user = False dbfilter = odoo* demo = {} email_from = False geoip_database = /usr/share/GeoIP/GeoLiteCity.dat 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 = logrotate = True 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 = web smtp_password = False smtp_port = 25 smtp_server = localhost smtp_ssl = False smtp_user = False syslog = False test_commit = False test_enable = False test_file = False test_report_directory = False translate_modules = ['all'] unaccent = False without_demo = False workers = 0
创建文件存储目录
mkdir data-12.0
最后启动odoo12服务
./start-odoo-12.0
配置后的odoo-prod目录下的内容大致如下图所示
然后在浏览器中输入 127.0.0.1:8069
在数据库界面中输入如下数据:
Master Password: odoo12.0@7867 注意:这里的密码必须和production-12.conf中的一致,否则报权限错误
Database Name: odoo12_p1 因为设置的过滤器是odoo*,所以必须以odoo开头
Email: guohuanhuan_cool@126.com 这个就是管理员登录账号
password: odoo12_p1@123 管理员账号密码
安装大象数据库的图形化操作pgadmin3
sudo apt-get install pgadmin3
设置postgres用户密码:
切换到ubuntu下postgres用户,登录postgres数据库
sudo su postgres psql alter user postgres with password 'postgres';
启动pgadmin3
添加本地数据库配置,Name随便写,Host输入localhost,Port输入5432,Maintenance DB和Username、Password都是postgres
安装PyCharm软件,从16.04开始支持命令行的安装了
社区版
sudo snap install pycharm-community --classic
专业版
sudo snap install pychram-profession --classic