acsone / click-odoo-contrib

Useful Odoo scripts and utility functions, based on click-odoo
GNU Lesser General Public License v3.0
107 stars 59 forks source link

Add --replace to click-odoo-initdb #73

Open yajo opened 4 years ago

yajo commented 4 years ago

As click-odoo-initdb is most useful for development, one good improvement IMHO would be to autodelete the chosen db if existing.

So, if I execute: click-odoo-initdb -rn devel -m web_responsive and devel exists, the script deletes it before re-creating it (maybe from cache, and all that stuff it does).

I think it would lower the barrier for development.

Should it call click-odoo-dropdb behind the scenes? If so, is there an easy or supported way to do it with click without a subprocess?

sbidoul commented 4 years ago

Why not. A subprocess call is probably the safest and easiest.

sbidoul commented 4 years ago

It'd be equivalent to click-odoo-dropdb --if-exists DBNAME && click-odoo-initdb ...