How Can We Help?
於 CentOS 7.0 安裝 odoo 9.0
此篇教學是使用 CentOS 7.0 Minimal ISO – CentOS-7-x86_64-Minimal-1611.iso 安裝初始系統
yum -y update yum install -y open-vm-tools yum install -y epel-release yum install -y vim yum install -y postgresql-server
初始化 PostgreSQL DB
postgresql-setup initdb
啟動 postgresql 並設定為開機服務
systemctl start postgresql systemctl enable postgresql
設定 PostgreSQL 的預設登入密碼
sudo -u postgres psql postgres=# \password postgres Enter new password: Enter it again: postgres=# \q
建立 Odoo 9.0 的 yum repo
vim /etc/yum.repos.d/odoo.repo
輸入以下內容
[odoo-nightly] name=Odoo Nightly repository baseurl=http://nightly.odoo.com/9.0/nightly/rpm/ enabled=1 gpgcheck=1 gpgkey=https://nightly.odoo.com/odoo.key
安裝 Odoo 9.0
yum install -y odoo
啟動 odoo 並設定為開機服務
systemctl start odoo systemctl enable odoo
編輯 odoo config 檔
vim /etc/odoo/openerp-server.conf admin_passwd = 要使用的密碼 addons_path = /opt/apps_odoo9,/usr/lib/python2.7/site-packages/openerp/addons workers = 17limit_memory_hard = 805306368 limit_memory_soft = 671088640limit_request = 8192 limit_time_cpu = 60 limit_time_real = 120 max_cron_threads = 2
設定完成後重新啟動 odoo
systemctl restart odoo
easy_install xlrd
要下載 WKHTMLTOPDF
yum -y install wkhtmltox-0.12.2.1_linux-centos7-amd64.rpm
http://linoxide.com/linux-how-to/setup-openerp-odoo-centos-7/
Install Odoo 8 (OpenERP) in CentOS & Red Hat Enterprise Linux
$ sudo yum-config-manager –add-repo=https://nightly.odoo.com/8.0/nightly/rpm/odoo.repo
Danger
to print PDF reports, you must install wkhtmltopdf yourself: the version of wkhtmltopdf available in Fedora/CentOS repositories does not support headers and footers so it can not be installed automatically. Use the version available on the wkhtmltopdf download page.
Configuration
The configuration file can be found at /etc/odoo/openerp-server.conf
When the configuration file is edited, Odoo must be restarted via SystemD:
$ sudo systemctl restart odoo
odoo location
/usr/lib/python2.7/site-packages/openerp/addons
odoo config file
/etc/odoo/openerp-server.conf
logfile = /var/log/odoo/odoo-server.log
apt-get -y install xfonts-75dpi xfonts-base wkhtmltox
dpkg -i wkhtmltox-0.12.2.1_linux-precise-i386.deb
cd /usr/share/fonts/
wget http://okay.googlecode.com/files/DejaVuSans-Oblique.ttf http://okay.googlecode.com/files/DejaVuSans-BoldOblique.ttf http://okay.googlecode.com/files/DejaVuSans-Bold.ttf http://okay.googlecode.com/files/DejaVuSans.ttf
fc-cache -fv
https://www.odoo.com/forum/help-1/question/how-to-use-custom-fonts-in-rml-reports-71030
參照上方的方式載入字型
接下來修改 rml report 中的 stylesheet
在用到的 paraStyle 中加入 fontName=”DejaVuSansYuanTi-Regular”
*******
如果要安裝report_xls or Export Current View 模組需要安裝相關的模組
easy_install xlwt
Aeroo report on CentOS 7.0
easy_install genshi lxml uno pyoo
yum install cairo-devel
cd /opt/odoo_apps
git clone https://github.com/aeroo/aeroolib.git
cd /opt/odoo_apps/aeroolib
python setup.py install
#9 sudo vi /etc/init.d/office
#!/bin/sh
/usr/bin/soffice –nologo –nofirststartwizard –headless –norestore –invisible “–accept=socket,host=localhost,port=8100,tcpNoDelay=1;urp;” &
yum install libreofficelibreoffice-headless libreoffice-pyuno
easy_install jsonrpc2 daemonize configparser
cd /opt/odoo_apps
git clone https://github.com/aeroo/aeroo_docs.git
cd aeroo_docs/
python /opt/odoo_apps/aeroo_docs/aeroo-docs start -c /etc/aeroo-docs.conf
ln -s ‘/opt/odoo_apps/aeroo_docs/aeroo-docs’ ‘/etc/systemd/system/multi-user.target.wants/aeroo-docs’
echo /opt/openoffice4/program |tee /usr/lib/python2.7/site-packages/unohelper.pth
python /opt/odoo_apps/aeroo_docs/aeroo-docs start -c /etc/aeroo-docs.conf
卡住了
sudo ldconfig -v /usr/lib/openoffice/program
systemctl start nginx.service
systemctl enable nginx.service
git clone https://github.com/aeroo/aeroolib.git
git clone https://github.com/aeroo/aeroolib.git
pyoo??
python-relatorio: A templating library able to output odt and pdf files
python-genshi: Toolkit for stream-based generation of output for the web
PyYAML: YAML parser and emitter for Python
pycairo: Python bindings for the cairo library
pycha (install through python self installer # easy_install pycha, not included in base Centos distribution)
python-openoffice: Python libraries for interacting with OpenOffice.org
openoffice.org-pyuno : Python bindings for OpenOffice.org
OpenOffice.org v.2.3.x or above.
參考資料:
How to install Odoo 9 on a CentOS 7 VPS
Setting Up OpenERP (Odoo) 9 with Nginx on RHEL/CentOS and Debian/Ubuntu