Community mailing list archives

Re: Dev Advice

Holger Brunn
- 06/14/2016 13:59:41
> Now, when I use a pre-seeded
> Database as template and want to create a new one, the logs show that there
> is a problem initializing base as apparently when creating a database odoo
> tries to initialize base regardless of respecting weather it's already
> installed in the template. Remember, that I cannot just copy the templates
> as I have purposefully filtered them away to make sure I never touch them
> and they don't clutter my workflow and I don't want to interact directly on
> the db docker as this means yet another console window. I assume that this
> initialization is not a big deal as it just fails softly, but I would argue
> that database creation could possibly respect this use case of the template
> flag.

How do you create your database on odoo terms?
Odoo doesn't have a notion where your database came from, so there's not a lot 
to expect from Odoo here. It also shouldn't care in my opinion and do what the 
user asks, and if the user asks for a reinitialization, then it should do just 
that. But, not all modules like being reinitialized, some even fail hard in 
that case. You probably have some wrapper script that actually passes the --
init= parameter? Then query the database first for
select name from ir_module_module where state='installed'
remove those from the modules you init, and run an --update for the already 
installed modules afterwards, in case there were code changes that need to be 
passed to the database. This will be inefficient, because updating base 
basically means updating everything.
Why do you need the init of base in the first place?

Therp - Maatwerk in open ontwikkeling

Holger Brunn - Ontwerp en implementatie