Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
4 Trả lời
6672 Lượt xem

Upon first run we need to configure the app - and this is done manually.

It takes us to `https://example.com:8069/web/database/manager` and asks for this:

- Database Name
- Email
- Password
- Phone number
- Language
- Country
- Demo data

I noticed that in `odoo.conf` we can set some variables:
- `admin_passwd` -> corresponds to "Password"
- `db_name` -> corresponds to "Database Name"

But what about the other fields? And what about configuring SMTP, etc.?

We need to automate this - so how can we pre-configure everything before first run.?

Ảnh đại diện
Huỷ bỏ

For customization tips:

https://goo.gl/8HgnCF

Câu trả lời hay nhất

Hi, John


You can do this by using the command line with this command.

Command:

curl 'your-url/web/database/create' --data 'master_pwd=your-master-pwd&name=your-database-name&login=your-login&password=your-password&phone=your-phone&lang=your-lang-code&country_code=your-country-code&demo=0or1' --compressed

Example:

curl 'odoo.com/web/database/create' --data 'master_pwd=123456&name=new_database&login=admin&password=admin&phone=457858&lang=en_US&country_code=us&demo=1' --compressed

By this command a database will be created named 'new_database' with user 'admin', password 'admin', language 'English US', country 'US' and demo data.

If you want to do this by using code then you need to override the config file. By this, you can set the required fields in the config file and automate this process.

For more assistance, you can contact support@webkul.com


Thanks,
Aman Prakash
Webkul Software Private Limited
Ảnh đại diện
Huỷ bỏ
Tác giả

Yes I realize that - which is why I asked if there is another way. Maybe there is another config file somewhere, or I can update a table, something like that.

Câu trả lời hay nhất

Hello

I think you can create standard database and install the modules and do the configuration  then restore or duplicated it instead of create database from scratch.

 


Ảnh đại diện
Huỷ bỏ
Tác giả

True... if there is no automated way to spin up a new ready instance, then creating a "baseline" image may be the only way.

Câu trả lời hay nhất

Hello
I automated odoo database creation.
My solution is in my github: GitRahim/odoo-auto-create-database 

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

Thanks for the replies so far.

To someone from the odoo team: is there a way to automate first run?

If the settings are not stored in plain text files, can we set some database fields to be able to spin up a ready instance?

When odoo is part of a ansible/docker environment, automation is important. There is surely a way.

Ảnh đại diện
Huỷ bỏ

Hello John,

You can do this by using the command line with this command.

Command: curl 'your-url/web/database/create' --data 'master_pwd=your-master-pwd&name=your-database-name&login=your-login&password=your-password&phone=your-phone&lang=your-lang-code&country_code=your-country-code&demo=0or1' --compressed

Example: curl 'odoo.com/web/database/create' --data 'master_pwd=123456&name=new_database&login=admin&password=admin&phone=457858&lang=en_US&country_code=us&demo=1' --compressed

By this command a database will be created named 'new_database' with user 'admin', password 'admin', language 'English US', country 'US' and demo data.

If you want to do this by using code then you need to override the config file. By this, you can set the required fields in the config file and automate this process.

For more assistance, you can contact support@webkul.com

Tác giả

Very good idea... Thank you!

Tác giả

If you add that as a separate answer then I can mark as resolved :)

Hello John,

I've updated my first answer. Please review it.

Now you can mark this as resolved.

Thanks

Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 3 24
3090
0
thg 11 22
2172
2
thg 2 22
5821
0
thg 11 21
2745
0
thg 6 21
1887