1
votes

I'm confused about how Odoo selects the database to use when starting the server.

I have a few databases. The database todo is the database that I'm using to develop my application. The only app that I have installed in the todo database is my todo app. I started my server through PowerShell (I'm on Windows) using ./odoo-bin.exe -d todo -u todo_app --test-enable From my understanding, this should start the server using the todo database. However, when I look at odoo.log, I see a bunch of tests running from other apps that aren't installed in the todo database. Those apps and tests are installed in a different database.

If I go to /web/database/selector and select my todo database, then restart my server, it works as expected with only the tests in my todo database running, and only the todo app showing as being installed on the Odoo web page.

It seems like Odoo is ignoring the -d flag to odoo-bin and always using the last database that I selected through the web page.

Is that how it's supposed to work and am I wrong about how the -d flag works?

How do I get Odoo to select its database from odoo-bin rather than having to go to /web/database/selector change databases after starting the server?

1

1 Answers

2
votes

-d flag doesn't mean select automatically that database it tells odoo to create that database if it's not there and run upgrade on todo if it's installed (-u todo).

You can use dbfilter option to use only one database. Example:

--db-filter='todo'

I'm on my phone sorry for my short answer