ODOO的命令行调用以及config默认值

时间:2021-01-25 02:34:58

通过odoo-bin 可以启动odoo server ,启动的过程中需要提供一些args,包括数据库设置,ip设置等

如果不想每次输入这些参数,可以直接修改odoo/tools/config.py中的默认值来完成

  group = optparse.OptionGroup(parser, "Database related options")
group.add_option("-d", "--database", dest="db_name", my_default=False,
help="specify the database name")
group.add_option("-r", "--db_user", dest="db_user", my_default='odoo',--原来为False
help="specify the database user name")
group.add_option("-w", "--db_password", dest="db_password", my_default='odoo',--原来为False
help="specify the database password")
group.add_option("--pg_path", dest="pg_path", help="specify the pg executable path")
group.add_option("--db_host", dest="db_host", my_default='127.0.0.1',--原来为空
help="specify the database host")
group.add_option("--db_port", dest="db_port", my_default='',
help="specify the database port", type="int")
group.add_option("--db_maxconn", dest="db_maxconn", type='int', my_default=,
help="specify the the maximum number of physical connections to posgresql")