安裝odoo 9實錄


安裝Ubuntu,省略

   

下載 odoo源碼

   

使用 git 下載源碼

mkdir /opt/openerp/server

cd /opt/openerp/server

git clone https://github.com/odoo/odoo.git

git checkout master

   

或者下載源碼壓縮包,然后解壓縮到 /opt/openerp/server

   

如果github訪問速度慢,使用鏡像 https://git.oschina.net/jeffery9/odoo

   

   

准備數據庫

   

安裝 postgresql

   

sudo apt-get install postgresql

   

創建postgres 用戶odoo

   

sudo -u postgres

createuser --createdb --no-createrole --no-superuser --pwprompt odoo

   

如果數據和odoo 應用服務器分別在不同的機器上,請查閱相關文檔,修改postgresql 的偵聽地址和訪問授權。

   

安裝odoo需要的 python 庫

 

odoo源碼目錄下的 requirements.txt 文件里面列出了依賴的所有Python庫

   

Babel==1.3

Jinja2==2.7.3

Mako==1.0.1

MarkupSafe==0.23

Pillow==2.7.0

Python-Chart==1.39

PyYAML==3.11

Werkzeug==0.9.6

argparse==1.2.1

decorator==3.4.0

docutils==0.12

feedparser==5.1.3

gdata==2.0.18

gevent==1.0.1

greenlet==0.4.5

jcconv==0.2.3

lxml==3.4.1

mock==1.0.1

ofxparse==0.14

passlib==1.6.2

psutil==2.2.0

psycogreen==1.0

psycopg2==2.5.4

pyPdf==1.13

pydot==1.0.2

pyparsing==2.0.3

pyserial==2.7

python-dateutil==2.4.0

python-ldap==2.4.19

python-openid==2.2.5

pytz==2014.10

pyusb==1.0.0b2

qrcode==5.1

reportlab==3.1.44

requests==2.6.0

simplejson==3.6.5

six==1.9.0

suds-jurko==0.6

unittest2==0.8.0

vatnumber==1.2

vobject==0.6.6

wsgiref==0.1.2

xlwt==0.7.

   

以二進制包的方式安裝

   

可以使用 apt-get 安裝這些依賴的python 庫, 執行命令

   

apt-get install python-dateutil python-decorator python-docutils python-feedparser python-imaging python-jinja2 python-ldap python-libxslt1 python-lxml python-mako python-mock python-openid python-passlib python-psutil python-psycopg2 python-pybabel python-pychart python-pydot python-pyparsing python-pypdf python-reportlab python-requests python-simplejson python-suds python-tz python-unittest2 python-vatnumber python-vobject python-werkzeug python-xlwt python-yaml python-gevent

   

因為ofxparse 可能對於某些ubuntu 版本沒有構建好的 庫,需要源碼安裝

   

使用 pip install ofxparse 安裝 它

   

以源碼的方式安裝

   

或者使用 pip

   

因為lxml ldap psycopg2 需要使用gcc進行編譯,所以,需要安裝庫libxml2, libxslt, libpq-dev, libldap2-dev, libsasl2-dev

   

使用命令 apt-get install libxml2 libxslt-dev libpq-dev libldap2-dev libsasl2-dev

安裝他們

   

apt-get install python-pip

 

pip install -r /opt/openerp/server/requirements .txt

   

推薦以二進制包的方式安裝 Python 庫,對於個別的沒有二進制deb包的,才使用 pip進行源碼安裝

   

安裝less

 

因為官方的npm鏡像無法正常訪問,必須訪問國內的鏡像,而國內的npm鏡像太新,所以需要使用較新版本的nodejs 【unbuntu 12自帶的nodejs版本是0.6】

   

使用以下命令 最新版本的nodejs

curl -sL https://deb.nodesource.com/setup | sudo bash -

apt-get install -y nodejs

   

安裝 less,

npm install -g less less-plugin-clean-css

   

安裝 sass

   

apt-get install ruby-sass

   

注意

如果無法以https模式訪問 npm注冊,切換為http模式

npm config set registry http://registry.npmjs.org

   

或者切換到 國內的npm 鏡像站

npm config set registry http://registry.cnpmjs.org

   

   

設置odoo config文件和啟動腳本

   

最小配置如下

[options]

; This is the password that allows database operations:

; admin_passwd = admin

db_host = 127.0.0.1

db_port = 5432

db_user = odoo

db_password = 1234

log_level = warn

   

addons_path =/opt/openerp/server/openerp/addons,/opt/openerp/server/addons

   

auto_reload = True

;workers = 2

   

   

安裝啟動腳本

   

/opt/openerp/server/debian/init 拷貝至 /etc/init.d/ 並改名為 odoo

   

修改 odoo 調整相應設置項目的正確路徑

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin

DAEMON=/opt/openerp/server/openerp-server

CONFIG=/opt/openerp/openerp-server.conf

LOGFILE=/var/log/openerp/openerp-server.log

   

   

創建odoo數據庫和安裝基本應用

   

 

   

選擇菜單 modules,安裝需要的應用

   

如果沒有安裝lessc 就會如下圖顯示

   

懶人模式

   

使用VM鏡像文件

從百度雲下載鏡像  https://pan.baidu.com/s/1slEN1LV     

VM的用戶名odoo 密碼0

  

 

最后,安裝Python包的另外一個方式,按照requirements.txt里面的清單,至

http://www.lfd.uci.edu/~gohlke/pythonlibs/   下載wheel 格式的安裝包, 然后使用 pip 安裝它

 

 

 

 

   


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM