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

建立快捷啓動可執行文件css

vim statrt-odoo12.0

具體內容以下:html

#! /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} "$@"

添加執行權限node

chmod +x start-odoo12.0

建立production-12.conf文件python

vim production-12.conf

具體內容以下linux

[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

建立文件存儲目錄git

mkdir data-12.0

最後啓動odoo12服務github

./start-odoo-12.0

配置後的odoo-prod目錄下的內容大體以下圖所示web

 

而後在瀏覽器中輸入 127.0.0.1:8069sql

在數據庫界面中輸入以下數據:數據庫

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
相關文章
相關標籤/搜索