配置

有2个配置文件:

  • 客户端配置文件: ~/.openerprc

  • 服务端配置文件: ~/.openerp_serverrc

这些文件遵循python的ConfigParser模块规范。

以”#”或者”;”开头的行是注释。

客户端第一次启动会自动生成配置文件。服务端配置文件可以使用下面命令生成:

  1. openerp-server.py -s

如果上面的配置文件不存在,服务端和客户端将按照默认配置启动。

Server Configuration File

服务端配置文件 .openerp_serverrc 用于保存服务启动参数。 以下是可用的参数:

interface:

服务器绑定的IP地址

port:

监听端口

database:

数据库名称

user:

数据库连接帐号用户名

translate_in:

导入翻译文件

translate_out:

导出翻译文件

language:

默认载入语言. 必须是符合 W3C 标准的 ISO 国家代码,

verbose:

开启调试输出

init:

初始化模块 (“all” 参数为初始化所有模块)

update:

升级模块 ( “all” 参数为升级所有模块)

upgrade:

升级/安装/卸载 模块

db_name:

指定数据库名

db_user:

数据库用户名

db_password:

数据库密码

pg_path:

PostgreSQL可执行文件所在路径

db_host:

数据库主机名或IP地址

db_port:

数据库端口

translate_modules:
 

指定导出翻译模块,与 —i18n-export 参数一起使用

通过指定 -s 或 —save 参数从命令行启动服务,可以创建你自己的配置文件。 你也可以使用 -c <配置文件路径> 或 —config=<配置文件路径> 参数,加载配置文件启动服务。 以下是基本的服务端配置:

  1. [options]
  2. verbose = False
  3. xmlrpc = True
  4. database = terp
  5. update = {}
  6. port = 8069
  7. init = {}
  8. interface = 127.0.0.1
  9. reportgz = False

OpenERP GTK 客户端V5.0的配置文件示例

  1. [printer]
  2. path = none
  3. softpath_html = none
  4. preview = True
  5. softpath = none
  6. [logging]
  7. output = stdout
  8. logger =
  9. verbose = True
  10. level = error
  11. [help]
  12. index = http://www.openerp.com/documentation/user-manual/
  13. context = http://www.openerp.com/scripts/context_index.php
  14. [form]
  15. autosave = False
  16. toolbar = True
  17. [support]
  18. recipient = support@openerp.com
  19. support_id =
  20. [tip]
  21. position = 0
  22. autostart = False
  23. [client]
  24. lang = en_US
  25. default_path = /home/user
  26. filetype = {}
  27. theme = none
  28. toolbar = icons
  29. form_tab_orientation = 0
  30. form_tab = top
  31. [survey]
  32. position = 3
  33. [path]
  34. pixmaps = /usr/share/pixmaps/openerp-client/
  35. share = /usr/share/openerp-client/
  36. [login]
  37. db = eo2
  38. login = admin
  39. protocol = http://
  40. port = 8069
  41. server = localhost

GTK-Client Configuration

login section

login:

login name to use to connect to OpenERP server

server:

address used by the server

port:

port used by the server

path section

share:

path used to find OpenERP shared files

pixmaps:

path used to find OpenERP pixmaps files

tip section

autostart:

Should the client display tips at startup

position:

Tip number the client will display

form section

autosave:

The client will automatically save the change you made to a record

printer section

preview:

Preview report before printing

softpath:

Path to the pdf previewer

softpath_html:

Path to the html previewer

path:

Command used to print

logging section

logger:

log channels to display. List values are: @common@, @common.message@, @view@, @view.form@, @common.options@, @rpc.request@, @rpc.result@, @rpc.exception@

level:

logging level to show

output:

file used by the logger

verbose:

set the log level to INFO

client section

default_path:

Default path used by the client when saving/loading datas.

Default values:

  1. [login]
  2. login = admin
  3. port = 8069
  4. server = 192.168.1.4
  5. [printer]
  6. path = none
  7. preview = True
  8. softpath = none
  9. [logging]
  10. output = stdout
  11. logger =
  12. verbose = True
  13. level = ERROR
  14. [form]
  15. autosave = False
  16. [client]
  17. default_path = /home/user

Web Client Configuration

Full Example for web Client Configuration

  1. [global]
  2. # Some server parameters that you may want to tweak
  3. server.socket_host = "0.0.0.0"
  4. server.socket_port = 8080
  5. # Sets the number of threads the server uses
  6. server.thread_pool = 10
  7. server.environment = "development"
  8. # Simple code profiling
  9. server.profile_on = False
  10. server.profile_dir = "profile"
  11. # if this is part of a larger site, you can set the path to the TurboGears instance here
  12. server.webpath = ""
  13. #[logging]
  14. #log.access_file = "/var/log/openerp-web/access.log"
  15. #log.error_file = "/var/log/openerp-web/error.log"
  16. # OpenERP Server
  17. [openerp]
  18. host = 'localhost'
  19. port = '8070'
  20. protocol = 'socket'
  21. # Web client settings
  22. [openerp-web]
  23. # filter dblists based on url pattern?
  24. # NONE: No Filter
  25. # EXACT: Exact Hostname
  26. # UNDERSCORE: Hostname_
  27. # BOTH: Exact Hostname or Hostname_
  28. dblist.filter = 'NONE'
  29. # whether to show Databases button on Login screen or not
  30. dbbutton.visible = True
  31. # will be applied on company logo
  32. company.url = ''
  33. # options to limit data rows in M2M/O2M lists, will be overriden
  34. # with limit="5", min_rows="5" attributes in the tree view definitions
  35. child.listgrid.limit = 5
  36. child.listgrid.min_rows = 5

Get a clone of each repository:

  1. bzr clone lp:~openerp/openobject-server/trunk server
  2. bzr clone lp:~openerp/openobject-client/trunk client
  3. bzr clone lp:~openerp/openobject-client-web/trunk client-web
  4. bzr clone lp:~openerp/openobject-addons/trunk addons

If you want to get a clone of the extra-addons repository, you can execute this command:

  1. bzr clone lp:~openerp-commiter/openobject-addons/trunk-extra-addons extra-addons

run the setup scripts in the respective directories:

  1. python2.5 setup.py build
  2. sudo python2.5 setup.py install

Currently the initialisation procedure of the server parameter —init=all to populate the database seems to be broken in trunk.

It is recommended to create a new database via the gtk-client. Before that the web-client will not work.

Start OpenERP server like this:

  1. ./openerp-server.py --addons-path=~/home/workspace/stable/addons

The bin/addons will be considered as default addons directory which can be overriden by the ~/home/workspace/stable/addons. That is if an addon exists in bin/addons as well as ~/home/workspace/stable/addons (custom path) the later one will be given preference over the bin/addons (default path).