I want to start Odoo from command line with database, language and country selected from command line.. Is that possible?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- 会計
- 在庫
- PoS
- Project
- MRP
この質問にフラグが付けられました
Hello, George!)
Tested on Odoo 14.
You can use curl or wget from terminal to achieve your goal:
curl -X POST -F 'master_pwd=dev' -F 'name=db_name_test' -F 'login=admin' -F 'password=admin' -F 'lang=ru_RU' -F 'country_code=by' -F 'phone=+375336665544' http://localhost:11469/web/database/create
Strange, but phone is made required (post['phone'] is used instead post.get('phone'), so you need to provide it not to catch the error.
Original code which parses data posted to /web/database/create:
Hi George
did you find the option to set the country in the command line? I'm trying to use the same command to create automatically the DB in a script
currently I'm using
./odoo-bin -c ~/.odoorc -d mycompany -i base --load-language it_IT --stop-after-init
and I'd like to have something like
./odoo-bin -c ~/.odoorc -d mycompany -i base --load-language it_IT --country IT --stop-after-init
but it doesn't work
thanks in advance
Hi, sorry for the late answer, but the parameters I've found are
-d database_name -i base --no-http --load-language=it_IT --stop-after-init
I want to specify the country on database creation .. there is language and country when creating a database so i want to select that from command line is that possible?
As far as I know the db creation is a manual step. If you want to automate it, you may have to write a shell script using curl or wget to simulate the manual step. The following link provides information on how to use it for automated backup. You could write a similar script for database creation.
https://linuxize.com/post/how-to-setup-automatic-odoo-backup/
Hope this helps.
You can specify the database on the command line by using the --db-filter parameter. The language and country are specified at the time of creating the database itself.