centos 安装 openerp

遇到问题:近日公司提出openerp的搭建,觉得openerp里的有些模块比较适合公司,openerp的运作,估计会有利于公司系统化的管理。于是我就去了解openrp,然后来搭建这套强大的系统。

解决问题:linux下搭建openerp。

实验环境:linux系统:centos   我用的是centos 6.2版本

                openerp 包:使用的是6.0.3版本。

搭建步骤

1.  准备工作

1)      网络连通性,因为后续会有许多依赖包需要yum的安装。配置ip地址,dns等,保证可以上网。
2)     在此http://www.openerp.com/download/stable/source/ 下载openerp-server-6.0.3.tar.gz,openerp-web-6.0.3.tar.gz 准备安装包 
3)      创建普通用户openerp,(启动openerp-server服务不可以使用root用户)
      useradd –s /bin/bash openerp
2.    Yum安装依赖软件。(有模块没安装,就会导致后面启动服务的一些错误)
yum -y install python.x86_64
yum -y install python-setuptools.noarch
yum -y install python-reportlab.x86_64
yum -y install python-dateutil.noarch
yum -y install python-mako.noarch
yum -y install libxml2-python.x86_64
yum -y install libxml2.x86_64
yum -y install python-lxml.x86_64
yum -y install libtool.x86_64
yum -y install libxslt.x86_64
yum -y install python-psycopg2.x86_64
yum -y install python-imaging.x86_64
 
3.安装postgreSQL数据库
yum -y groupinstall "PostgreSQL Database server"
yum -y groupinstall "PostgreSQL Database client"
 chkconfig --level 2345 postgresql on
service postgresql initdb   初始化数据库
小提醒:没有初始化,报错:
报错提示:/var/lib/pgsql/data is missing. Use "service postgresql initdb" to initialize the cluster first
service postgresql start 然后启动postgresql服务
 
4.切换到用户postgres(安装数据库默认创建的数据库用户)
 [root@localhost ~]#su – postgres   切换到postgres用户,创建数据库用户
-bash-4.1$createuser --created --no-createrole --pwprompt openerp      
      【单词的前面是两“-”】含义解释:createuser的参数解释。 -d 或者--createdb 允许该新建用户创建数据库,-D 或者—no-createrdb禁止该新建用户创建数据库。这个是默认。 --no-createrole 新用户将不允许创建新角色。这个是缺省。 --pwprompt 如何给出,createuser 将发出一个提示符要求输入新用户的口令。如果不打算用口令认证,那么这是不必要的。openerp 用户名
5. 安装openerp-server-6.0.3
[root@localhost ~]# tar zxvf openerp-server-6.0.3.tar.gz –C /usr/lib/python2.6/site-packages/
[root@localhost ~]# cd /usr/lib/python2.6/site-packages/openerp-server-6.0.3
[root@localhost openerp-server-6.0.3~]# python2.6 setup.py install 2>&1 | tee /tmp/openerp-server.log
[root@localhost ~]# chown –R openerp /usr/lib/python2.6/site-packages/openerp-server/addons
[root@localhost addons]#cp openerp-server /etc/init.d
6. 安装 openerp-web-6.0.3
[root@localhost ~]# tar zxvf openerp-web-6.0.3.tar.gz –C /usr/lib/python2.6/site-packages/
[root@localhost ~]# cd /usr/lib/python2.6/site-packages/openerp-web-6.0.3
[root@localhost openerp-web-6.0.3]# python2.6 setup.py install
[root@localhost openerp-web-6.0.3]#cd –
[root@localhost ~]# cp openerp-web /etc/init.d/
[root@localhost ~]# mkdir /var/log/openerp-web
[root@localhost openerp-web]#chown openerp /var/log/openerp-web
 
这样算基本安装完毕。于是启动服务。
[root@localhost ~]# /usr/bin/openerp-web start   启动openerp-web服务
[root@localhost ~]# su – openerp    切换到openerp用户
[openerp@localhost ~]$ openerp-server start 启动openerp-server服务。
7.启动server服务报错,会提示未安装yaml模块。于是yum安装,没有成功,然后下了yaml的包来安装。
PyYAML-3.10.tar.gz包
首先解压PyYAML的tar包。
[root@localhost ~]#tar zxvf /openerp/PyYAML-3.10.tar.gz
[root@localhost ~]# cd /openerp/PyYAML-3.10
[root@localhost PyYAML-3.10]# python setup.py install
[root@localhost PyYAML-3.10]# python setup.py test 

再次openerp-server服务重启,ok。没有报yaml模块的错了。
然后下面这个错误,有关postgresql的认证错误

解决办法:vi /var/lib/pgsql/data/pg_hba.conf 修改为了下图。有md5 ,trust等认证方式,具体分析。

然后重启postgresql数据库
[root@localhost ~]#/etc/rc.d/init.d/postgresql restart

 
8.此时在浏览器访问 http://IP:8080,可以连上

第一步就不需要登录,此时还没有数据库。需要点击database创建

接下来按照每一步的提示,操作完成,数据库建立完成。

然后我点开其中一个模块,报错

这是由于openerp不支持中文的时间格式而导致的报错。所以我们只需要更改即可。
解决方法:切换到扩展模式,登录进数据库,然后操作:系统管理→翻译→语言,然后编辑Chinese(CN)/简体中文,把日期格式“%Y年%m月%d日”改为“%Y%m%d”时间格式“%H时%M分%S秒”,改为“%H%M%S”.保存并退出erp,并重新登录。

重新登录openerp,没有提示报错了。

Flag Counter
原文地址:https://www.cnblogs.com/sunsoftware/p/centos-install-openerp.html