1、代碼拉?。?/h2>①、在github上直接下載進(jìn)行壓縮獲取代碼;  ②、通過(guò)終端命令進(jìn)行clone代碼;
git clone https://github.com/odoo/odoo.git --branch master --depth 1 --single-branch ./odoo12

2、安裝大象(postgresql)數(shù)據(jù)庫(kù):sudo apt-get install -y postgresql# 安裝完會(huì)自定生成 postgres用戶 用如下命令登錄sudo -u postgres psql# 創(chuàng)建用戶 此處創(chuàng)建用戶名為‘odoo12’ 密碼為‘123456’create user odoo12 superuser password '123456';  常用命令:
\h:查看SQL命令的解釋,比如\h select。\?:查看psql命令列表。\l:列出所有數(shù)據(jù)庫(kù)。\c [database_name]:連接其他數(shù)據(jù)庫(kù)。\d:列出當(dāng)前數(shù)據(jù)庫(kù)的所有表格。\d [table_name]:列出某一張表格的結(jié)構(gòu)。\du:列出所有用戶。\e:打開(kāi)文本編輯器。\conninfo:列出當(dāng)前數(shù)據(jù)庫(kù)和連接的信息。
①、配置大象數(shù)據(jù)庫(kù)(postgresql)的遠(yuǎn)程訪問(wèn): # 進(jìn)入 /usr/share/postgresql/9.5目錄打開(kāi)pg_hba.conf.sample 文件(文件所屬目錄根據(jù)創(chuàng)建而定)sudo vi pg_hba.conf.sample 修改前:
 修改后:
 注意:如未修改進(jìn)行外部訪問(wèn)在瀏覽器中會(huì)出現(xiàn)如下報(bào)錯(cuò): Uncaught Error: QWeb2: Template 'DashboardMain' not foundUncaught Error: QWeb2: Template 'mail.systray.MessagingMenu' not found
3、修改odoo.conf配置文件:
4、修改完運(yùn)行odoo-bin,然后在瀏覽器輸入 localhost:8069:此時(shí)會(huì)出現(xiàn)如下兩種情況: ①、數(shù)據(jù)庫(kù)設(shè)置,如下圖,恭喜你無(wú)BUG:
 ②、無(wú)法訪問(wèn),出現(xiàn)服務(wù)器故障, 如下bug: psycopg2.OperationalError: FATAL: role 'odoo11' does not exist - - -  解決方法:
sudo su - postgres -c 'createuser -s odoo11'
 個(gè)人認(rèn)為出現(xiàn)這樣的原因:是ubuntu當(dāng)前用戶為odoo11,因此影響的。
5、創(chuàng)建數(shù)據(jù)庫(kù): 注意:當(dāng)點(diǎn)擊“Create database”時(shí)頁(yè)面出現(xiàn)雜亂現(xiàn)象,如下圖: 原因:樣式無(wú)法加載;
 處理方法:
pip install libsass #在環(huán)境下安裝 libsass包 配置完成如下:
|