Odoo 配置项全解

配置文件openerp-server.conf详解

  1. [options]
  2. ; addons模块的查找路径(可以配多个,多个之间以逗号分隔)
  3. addons_path = /usr/local/odoo/source/openerp/addons
  4. ; 数据库管理密码(用于创建、还原和备份数据库等操作)
  5. admin_passwd = admin
  6. ; data目录, 用于存放session数据、附件、缓存文件等
  7. data_dir = data
  8. ;##################### 数据库相关配置####################
  9. ; 数据库主机名
  10. db_host = 127.0.0.1
  11. ; 数据库端口号
  12. db_port = 65432
  13. ; 数据库用户名
  14. db_user = openerp
  15. ; 数据库用户密码
  16. db_password = openerp
  17. ; 数据库的最大连接数
  18. db_maxconn = 64
  19. ; 指定要预加载的数据库,多个以逗号分隔
  20. db_name = False
  21. ;##################### 邮件相关配置####################
  22. ; 用于发送邮件的邮箱地址
  23. email_from = False
  24. ; SMTP服务器名
  25. smtp_server = localhost
  26. ; SMTP端口号
  27. smtp_port = 25
  28. ; SMTP服务器是否支持SSL协议
  29. smtp_ssl = False
  30. ; 发送邮件的SMTP用户名
  31. smtp_user = False
  32. ; 发送邮件的SMTP用户密码
  33. smtp_password = False
  34. ; 创建新数据库时使用的数据库模板
  35. db_template = template1
  36. ; 过滤要显示的供选择数据库名称
  37. dbfilter = .*
  38. ; 哪些模块不加载demo数据
  39. without_demo = xxx
  40. ; 一个处理器允许使用的最大物理内存, Odoo默认为2G
  41. limit_memory_hard = 2684354560
  42. ; 一个处理器允许使用的最大虚拟内存
  43. limit_memory_soft = 2147483648
  44. ; 一个处理器接受的最大请求数
  45. limit_request = 8192
  46. ; 一个请求最多占用多少处理器时间
  47. limit_time_cpu = 60
  48. ; 一个请求允许的最长处理时间
  49. limit_time_real = 120
  50. ;一个cron任务允许的最长执行时间,如果cron线程执行时间超过这个值会触发reload
  51. limit_time_real_cron=-1
  52. ; 是否允许显示数据库列表
  53. list_db = True
  54. ; 是否将log写入dbir_logging
  55. log_db = False
  56. ; 设置模块的日志级别,可以是一组module:log_level对, 默认值是“:INFO”(表示所有模块的默认日志级别为INFO)
  57. log_handler = :INFO
  58. ; 日志的级别, 可选值:debug_rpc_answer, debug_rpc, debug, debug_sql, info, warn, error, critical
  59. log_level = info
  60. ; 指定用来存储日志的文件
  61. logfile = openerp-server.log
  62. ; 是否按天存放日志
  63. logrotate = False
  64. ; 长连接池使用的端口号(当设置了此值后系统以gevent模式跑在这里指定的端口下)
  65. longpolling_port = 8072
  66. ; 处理当前计划任务的最大线程数
  67. max_cron_threads = 2
  68. ; 强制保存在virtual osv_memory表中的记录的最长时间,以小时为单位
  69. osv_memory_age_limit = 1.0
  70. ; 强制一个virtual osv_memory表的最大记录数
  71. osv_memory_count_limit = False
  72. ; 数据库可执行文件的路径
  73. pg_path = runtime/pgsql/bin
  74. ; 存储服务器pid的文件名
  75. pidfile = None
  76. ; 是否使用反向代理模式
  77. proxy_mode = False
  78. ; 是否压缩报表
  79. reportgz = False
  80. ; 指定用于SSL连接的证书文件
  81. secure_cert_file = server.cert
  82. ; 指定用于SSL连接的主密钥文件
  83. secure_pkey_file = server.pkey
  84. ; server范围的模块,以逗号分隔
  85. server_wide_modules = None
  86. ; 是否把日志发送给系统日志服务器
  87. syslog = False
  88. ; 是否提交YAMLXML测试造成的数据库更改
  89. test_commit = False
  90. ; 是否允许YAML和单元测试
  91. test_enable = False
  92. ; YML测试文件
  93. test_file = False
  94. ; 报表的范例的存放位置
  95. test_report_directory = False
  96. ; 为系统提供一个参照的时区
  97. timezone = False
  98. ; 哪些模块可翻译, 默认为all
  99. translate_modules = ['all']
  100. ; 是否使用数据库的unaccent功能
  101. unaccent = False
  102. ; 在安装时哪些模块不加载演示数据
  103. without_demo = False
  104. ; 要使用的处理器数量
  105. workers = None
  106. ;##################### xml服务相关配置####################
  107. ; 是否允许使用XML-RPC协议(即是否启用http服务),默认为True
  108. xmlrpc = True
  109. ; 指定使用XML-RPC协议的IP地址,为空时表示绑定到现有IP
  110. xmlrpc_interface =
  111. ; XML-RPC协议使用的TCP端口
  112. xmlrpc_port = 8069
  113. ; 是否允许使用XML-RPC安全协议,默认为True
  114. xmlrpcs = True
  115. ; 指定使用XML-RPC安全协议的IP地址,为空时表示绑定到现有IP
  116. xmlrpcs_interface =
  117. ; XML-RPC安全协议使用的TCP端口
  118. xmlrpcs_port = 8071

不在config文件中配置的命令行参数

  1. # Not exposed in the configuration file.
  2. self.blacklist_for_save = set([
  3. 'publisher_warranty_url', 'load_language', 'root_path',
  4. 'init', 'save', 'config', 'update', 'stop_after_init', 'dev_mode', 'shell_interface'
  5. ])

dev_mode

开启的开发模式选项,常用选项如下:

  • xml
  • reload (py文件变动自动重启)、
  • werkzeug (werkzeug DebuggedApplication)

stop_after_init

初始化后就停止,也是不启动http服务和cron服务

更详细的参数说明可以参看源码 odoo/tools/config.py


Related