配置
有2个配置文件:
客户端配置文件: ~/.openerprc
服务端配置文件: ~/.openerp_serverrc
这些文件遵循python的ConfigParser模块规范。
以”#”或者”;”开头的行是注释。
客户端第一次启动会自动生成配置文件。服务端配置文件可以使用下面命令生成:
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=<配置文件路径> 参数,加载配置文件启动服务。 以下是基本的服务端配置:
[options]
verbose = False
xmlrpc = True
database = terp
update = {}
port = 8069
init = {}
interface = 127.0.0.1
reportgz = False
OpenERP GTK 客户端V5.0的配置文件示例
[printer]
path = none
softpath_html = none
preview = True
softpath = none
[logging]
output = stdout
logger =
verbose = True
level = error
[help]
index = http://www.openerp.com/documentation/user-manual/
context = http://www.openerp.com/scripts/context_index.php
[form]
autosave = False
toolbar = True
[support]
recipient = support@openerp.com
support_id =
[tip]
position = 0
autostart = False
[client]
lang = en_US
default_path = /home/user
filetype = {}
theme = none
toolbar = icons
form_tab_orientation = 0
form_tab = top
[survey]
position = 3
[path]
pixmaps = /usr/share/pixmaps/openerp-client/
share = /usr/share/openerp-client/
[login]
db = eo2
login = admin
protocol = http://
port = 8069
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 data. |
---|
Default values:
[login]
login = admin
port = 8069
server = 192.168.1.4
[printer]
path = none
preview = True
softpath = none
[logging]
output = stdout
logger =
verbose = True
level = ERROR
[form]
autosave = False
[client]
default_path = /home/user
Web Client Configuration
Full Example for web Client Configuration
[global]
# Some server parameters that you may want to tweak
server.socket_host = "0.0.0.0"
server.socket_port = 8080
# Sets the number of threads the server uses
server.thread_pool = 10
server.environment = "development"
# Simple code profiling
server.profile_on = False
server.profile_dir = "profile"
# if this is part of a larger site, you can set the path to the TurboGears instance here
server.webpath = ""
#[logging]
#log.access_file = "/var/log/openerp-web/access.log"
#log.error_file = "/var/log/openerp-web/error.log"
# OpenERP Server
[openerp]
host = 'localhost'
port = '8070'
protocol = 'socket'
# Web client settings
[openerp-web]
# filter dblists based on url pattern?
# NONE: No Filter
# EXACT: Exact Hostname
# UNDERSCORE: Hostname_
# BOTH: Exact Hostname or Hostname_
dblist.filter = 'NONE'
# whether to show Databases button on Login screen or not
dbbutton.visible = True
# will be applied on company logo
company.url = ''
# options to limit data rows in M2M/O2M lists, will be overriden
# with limit="5", min_rows="5" attributes in the tree view definitions
child.listgrid.limit = 5
child.listgrid.min_rows = 5
Get a clone of each repository:
bzr clone lp:~openerp/openobject-server/trunk server
bzr clone lp:~openerp/openobject-client/trunk client
bzr clone lp:~openerp/openobject-client-web/trunk client-web
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:
bzr clone lp:~openerp-commiter/openobject-addons/trunk-extra-addons extra-addons
run the setup scripts in the respective directories:
python2.5 setup.py build
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. Until then the web-client will not work.
Start OpenERP server like this:
./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).