手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

Ubuntu Server 下 OpenERP安装笔记

[日期:2012-02-18] 来源:Linux社区  作者:kaiyuanlvzhou [字体:大 中 小]

安装 openerp-web

  1. 必要包
  2. Python >= 2.4
    CherryPy >= 3.1.2
    Mako >= 0.2.4
    Babel >= 0.9.4
    FormEncode >= 1.2.2
    simplejson >= 2.0.9
    pyparsing >= 1.5.0

    python-libxslt1
    postgresql-client
    python-hippocanvas
    python-matplotlib
    python-webdav

  3. 解决中文(不完整)问题
  4. 解决此问题需要更改源代码:

    $ sudo vi ~/openerp-web-6.0.3/openobject/i18n/_gettext.py

    将代码:

    if locale in domain_catalog:
    return domain_catalog[locale]

    更改为:

    if str(locale) in domain_catalog:
    return domain_catalog[str(locale)]

  5. 安装
  6. $ sudo python setup.py install

     

  7. 建立OpenERP-Web启动进程(daemon)
  8.  

    $ sudo vi /etc/init.d/openerp-web

    内容如下(注意更换为您自己的内容):

     
     #!/bin/sh
     #
     # Open ERP web 启动脚本
     #
     
     PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
     DAEMON=/home/yourname/openerp/openerp-web
     CONFIGFILE=/home/yourname/openerp/openerp-web.cfg
     NAME=openerp-web
     DESC=openerp-web
     
     USER=yourname
     
     test -x ${DAEMON} || exit 0
     
     set -e
     
     case “${1}” in
         start)
             echo -n “Starting ${DESC}: ”
     
         start-stop-daemon –start –quiet –pidfile /var/run/${NAME}.pid \
                 –chuid ${USER} –background –make-pidfile \
                 –exec ${DAEMON} — –config=${CONFIGFILE}
     
             echo “${NAME}.”
             ;;
     
         stop)
             echo -n “Stopping ${DESC}: ”
     
             start-stop-daemon –stop –quiet –pidfile /var/run/${NAME}.pid \
                 –oknodo
     
             echo “${NAME}.”
             ;;
     
         restart|force-reload)
             echo -n “Restarting ${DESC}: ”
     
             start-stop-daemon –stop –quiet –pidfile /var/run/${NAME}.pid \
                 –oknodo
     
             sleep 2
     
             start-stop-daemon –start –quiet –pidfile /var/run/${NAME}.pid \
                 –chuid ${USER} –background –make-pidfile \
                 –exec ${DAEMON} — –config=${CONFIGFILE}
     
             echo “${NAME}.”
             ;;
     
         *)
             N=/etc/init.d/${NAME}
             echo “Usage: ${NAME} {start|stop|restart|force-reload}” >&2
             exit 1
             ;;
     esac
     
     exit 0

    (内容结束)
    然后进行如下操作:

    $ cp /doc/openerp-web.cfg /etc/
    $ sudo chown -R openerp /etc/openerp-web.cfg
    $ sudo chown -R openerp /addons
    $ sudo chown -R openerp /etc/init.d/openerp-web
    $ sudo chmod +x /etc/init.d/openerp-web

    更改配置文件openerp-web.cfg

    log.accessfile = “var/log/openerp-web/access.log”
    log.error
    file = “var/log/openerp-web/error.log”

    并且,进行如下操作:

    $ sudo mkdir -p /var/log/openerp-web
    $ sudo touch /var/log/openerp-web/access.log
    $ sudo touch /var/log/openerp-web/error.log
    $ sudo chown -R openerp /var/log/openerp-web

    加入启动进程:

    $ sudo update-rc.d openerp-web defaults
    $ sudo /etc/init.d/openerp-web start

     

 


 

 

一些问题的解决

  • 如果发现出现以下错误:
  • <type ‘exceptions.UnicodeEncodeError’>: ‘ascii’ codec can’t encode character u’\u5e74′ in position 2: ordinal not in range(128)
    args = (‘ascii’, u’%Y\u5e74%m\u6708%d\u65e5 %H\u65f6%M\u5206%S\u79d2′, 2, 3, ‘ordinal not in range(128)’)

    解决方法:
    “系统管理-翻译-语言” 修改日期格式与时间格式,使其不包含汉字。
    感觉代码使用’ascii’有问题,应该是/usr/local/lib/python2.7/dist-packages/openerp_web-6.0.3-py2.7.egg/openobject/i18n/format.py出错了

  • wiki显示不正常,只显示为编辑模式(权限问题)
  • $ sudo chmod -R 777 [目录]

    目录可能包含3个:

    /usr/lib/pymodules/python2.x/openerp-server/addons
    /usr/share/pyshared/openerp-server/addons
    /usr/…/openerp-web/addons

     

  • 更改web页面右上角support支持地址
  • 更改这里:

    /usr/share/pyshared/openerp-server/addons/web_livechat/publisher_warranty.py

    函数getdefaultlivechat_text的返回值

    return ‘<a href=”http://www…(略)

  • 更改logo图片
  • 图片信息在 <openerp-web目录>/addons/openerp/static/css/screen.css 文件中, 可能会是 ../images/logo-bg.png

  • 打开web缓存
  • Opery Web Client:打开openerp-web.cfg,确认 server.environment = “production” (源码安装默认development)
    在cherrypy/cpserver.py文件中有两个重要参数,分别是46行的socketqueuesize = 5 和 51行threadpool = 10 ,这里修改为socketqueuesize = 500 和 thread_pool = 1000。(这两个参数如果在保持默认值的情况下,连并发100都跑不了。不明白CherryPY的默认值为什么这么低 …)

linux
相关资讯       Ubuntu Server  OpenERP 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款