Navigation

    Odoo 中文社区

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Popular
    • Users
    • Groups

    Odoo中文社区可以通过以下两个域名访问:shine-it.net , odoo.net.cn

    由于系统升迁的原因,本论坛部分较早期的内容存在格式和链接损坏失效的问题,并非本论坛系统本身的缺陷,望谅解

    本社区没有维护任何QQ群讨论组,任何与本社区同名的QQ群讨论组的言论与本社区无关!

    开发人员可以登录gitter讨论组: http://gitter.im/odoo-china/Talk, 需要github账号

    如果您登录系统碰到问题,请在微信公众号留言:

    Gentoo2008.0下安装TinyERP 4.2.2 Server手记

    Odoo 安装指南
    2
    3
    7551
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      dking last edited by

      一、前言
      因为需要一个小型的ERP,自己也希望对ERP方面进行学习,前几天在网上选型,看到了Simon的一些贴子,再看了一下TinyERP的介绍,觉得完全可以消化吸收这个结构简洁而灵活的系统为我所用。从安装到配置到使用的过程,除了可以学习这个系统,更可以借这个机会让自己较深入地学习掌握ERP的基础知识。
      对于TinyERP/OpenERP我是个完完全全的新手,这几天的工作也只是完成了TinyERP v4.2.2的初步安装,前进的道路还充满着未知,希望大家能多帮助指点。

      二、准备
      在查看了一下相关资料后,我计划在Linux上安装服务器,再编译一份Windows下的客户端。从官网上来看,GNU/Linux的各发行版本都可以安装。我手上正好新装了一台Gentoo,是基于2008.0安装的,于是就用它了。把网络配置好后就可以准备安装了。
      在安装前,正好发现Gentoo的python从2.4.4更新到2.5.2了,就更新一下Gentoo。
      [code]

      emerge --sync

      emerge --update --deep --newuse world

      emerge --depclean

      revdep-rebuild

      [/code]

      三、安装服务端
      3.1 安装Postgresql
      [code]
      emerge postgresql
      [/code]
      Gentoo下经过完全测试的PG版本是8.0.15,这个版本已经可以很好的在Tiny/OpenERP下工作了,所以如果没有其它因素,可以不必升级到最新的8.3.3。
      对PG时行初始化
      [code]
      emerge --config =postgresql-8.0.15
      [/code]
      把postgresql加入启动组
      [code]
      rc-update add postgresql default
      [/code]
      启动pg
      [code]
      /etc/init.d/postgresql start
      [code]

      创建terp用户及数据库:
      [code]

      createuser --username=postgres --createdb --no-adduser terp

      CREATE USER

      createdb --username=postgres --owner=terp --encoding=UNICODE terp

      CREATE DATABASE
      [/code]

      3.2 安装其它支持Python包
      [code]
      emerge pypgsql
      emerge reportlab
      emerge pyparsing
      emerge pydot
      emerge egenix-mx-base
      [/code]

      在接下来安装psycopg时遇到一点小问题,Gentoo缺省安装的是psycopg2,这将导致出现以下错误提示:
      [quote]psycopg.register_type(psycopg.new_type((1082,), "date", lambda x:x))
      AttributeError: 'module' object has no attribute 'register_type'
      [/quote]
      这是因为register_type在psycopg2里的位置发生了变化,如果有时间,当然可以去修改TinyERP,不过,对于一个新手,暂时还是不要乱动的好,所以得降级使用psycopg V1,不过这个版本在Gentoo中被masked了,安装它得修改package.keywords。
      因为是新装的Gentoo系统,还没有"/etc/portage"目录,手工建立它。
      [code]
      mkdir /etc/portage
      [/code]
      然后:
      [code]
      echo "=dev-python/psycopg-1.1.21" > /etc/portage/package.keywords
      emerge =dev-python/psycopg-1.1.21
      [/code]
      这样就行了。

      接着:
      [code]
      emerge libxml2
      emerge libxslt
      [/code]

      这里要说明的是
      1、请在安装psycopg前安装egenix-mx-base。
      2、在官网的wiki中说安装psycopg2完后,因为openerp缺省只认psycopg不认psycopg2,可以这么做
      [code]
      cp -a /usr/lib/python2.5/site-packages/psycopg2 /usr/lib/python2.5/site-packages/psycopg
      [/code]
      不过显然,这么做虽然可以让TinyERP/OpenERP找到psycopg包,但因代码的变化,还是存在兼容问题的。

      最后
      [code]
      emerge pytz
      emerge imaging
      [/code]

      3.3 下载安装TinyERP 4.2.2
      下载解压:
      [code]
      cd /tmp
      wget openerp.com/download/stable/source/tinyerp-server-4.2.2.tar.gz
      tar xzvf tinyerp-server-4.2.2.tar.gz
      cd tinyerp-server-4.2.2
      [/code]

      安装:
      [code]
      setup.py install --prefix=/usr/local
      [/code]

      初始始化:
      [code]
      mkdir /var/log/TinyERP
      chown terp /var/log/TinyERP/
      mkdir /var/run/TinyERP
      chown terp /var/run/TinyERP/

      su - terp
      /usr/local/bin/tinyerp-server --init=all --pidfile /var/run/TinyERP/tinyerp-server.pid --logfile=/var/log/TinyERP//tinyerp-server.log-s
      [/code]

      运行
      [code]
      /usr/local/bin/tinyerp-server
      [/code]
      或者作为守护进程运行:
      [code]
      start-stop-daemon --chuid=terp:nobody --background --startas /usr/local/bin/tinyerp-server
      [/code]
      OK
      服务器安装就完成了。

      用对应版本的客户端登录即可。

      此时用客户端登录后,界面里的菜单树显示的全部是英文,对于我们,当然要显示中文才比较方便,杀掉服务器,导入中文菜单:
      [code]
      /usr/local/bin/tinyerp-server -v --i18n-import=/usr/local/lib64/python2.5/site-packages/tinyerp-server/i18n/zh_CN.csv -lzh -dterp
      [/code]
      注意,我的机器的CPU是AMD64,安装的也是64位的Gentoo,以上翻译文件的位置可能与你的不同,请先用
      [code]
      find /usr -iname zh_CN.csv
      [/code]
      来查看在你机器上中文翻译文件的位置。

      另外,可以导入最新的界面翻译文件,可以从这里同步最新的翻译版本:
      www.shine-it.net/tinyerp/viewthread.php?tid=158&extra=page%3D1

      再导入即可。对于4.2.2版,使用最新版本翻译文件时可能会出现少量错误提示,比如:
      [quote]Mon, 21 Jul 2008 19:27:25 ERROR:init:Import error: list index out of range on line 2136: ['help', 'product.packaging,width', '0', 'The width of the palettexefxbcx8cxe5x9exabxe6x9dxbfxe5xaexbdxe5xbaxa6']!
      Mon, 21 Jul 2008 19:27:32 ERROR:init:Import error: list index out of range on line 5358: ['=======']!
      Mon, 21 Jul 2008 19:27:32 ERROR:init:Import error: list index out of range on line 5359: ['type', 'name', 'res_id', 'src', 'value']!
      Mon, 21 Jul 2008 19:27:37 ERROR:init:Import error: list index out of range on line 7494: ['help', 'product.packaging,width', '0', 'The width of the palettexefxbcx8cxe5x9exabxe6x9dxbfxe5xaexbdxe5xbaxa6']!
      [/quote]

      估计这是因为这些词条在这个版本中没有的原因,不用管了,再次打开客户端,就可以看到中文菜单树了。

      四、前进
      以上只是我完成TinyERP 4.2.2服务器的基本过程,希望后来者少走弯路。有不正确或理解错误的地方,请大家指正。
      非常感谢shine-it这个平台,从中了解了很多关于tinyerp的基础信息。

      1 Reply Last reply Reply Quote 0
      • digitalsatori
        digitalsatori 管理员 last edited by

        非常感谢dking提供的详尽,明了的安装说明。

        1 Reply Last reply Reply Quote 0
        • First post
          Last post