From 8bf6dd385ab923632dcda22f2f8509a89ab73dda Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Tue, 11 Feb 2025 11:33:59 +0100 Subject: [PATCH] [IMP] cli tools: default 'postgres' database. Rational: when calling oow psql, sometimes, we don't want to put a database. Example, if we call "oow -d postgres -c 'psql'". In that case, this improvment makes that default postgres database will be proposed in the 'prompt', if no database is provided --- newsfragments/+improving-psql-command-default-db.misc | 2 ++ odoo_openupgrade_wizard/cli/cli_options.py | 1 + 2 files changed, 3 insertions(+) create mode 100644 newsfragments/+improving-psql-command-default-db.misc diff --git a/newsfragments/+improving-psql-command-default-db.misc b/newsfragments/+improving-psql-command-default-db.misc new file mode 100644 index 0000000..952d5c2 --- /dev/null +++ b/newsfragments/+improving-psql-command-default-db.misc @@ -0,0 +1,2 @@ +set a default 'postgres' database in ``oow psql`` command, to avoid force user +to set a database, in case of dbless command. diff --git a/odoo_openupgrade_wizard/cli/cli_options.py b/odoo_openupgrade_wizard/cli/cli_options.py index 63d462c..76f7df8 100644 --- a/odoo_openupgrade_wizard/cli/cli_options.py +++ b/odoo_openupgrade_wizard/cli/cli_options.py @@ -59,6 +59,7 @@ def database_option_required(function): "--database", required=True, prompt=True, + default="postgres", type=str, help="Odoo Database for which you want to perform the operation.", )(function)