gOdoo-cli 0.11.6__tar.gz → 0.11.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/PKG-INFO +1 -1
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/pyproject.toml +1 -1
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/commands/db/query.py +12 -4
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/commands/shell.py +17 -1
- godoo_cli-0.11.7/src/godoo_cli/version.py +1 -0
- godoo_cli-0.11.6/src/godoo_cli/version.py +0 -1
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/LICENSE +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/README.md +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/__init__.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/__main__.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/cli.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/cli_common.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/commands/__init__.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/commands/backup/__init__.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/commands/backup/cli.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/commands/backup/dump.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/commands/backup/load.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/commands/backup/pull.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/commands/backup/util.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/commands/bootstrap.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/commands/config.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/commands/db/__init__.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/commands/db/cli.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/commands/db/connection.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/commands/db/passwords.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/commands/launch.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/commands/rpc/__init__.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/commands/rpc/cli.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/commands/rpc/config_parameters.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/commands/rpc/importer.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/commands/rpc/modules.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/commands/rpc/translations.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/commands/source_get.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/commands/test/__init__.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/commands/test/cli.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/commands/test/test_load_data.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/commands/test/test_run.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/git/__init__.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/git/git_odoo.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/git/git_odoo_addons.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/git/git_repo.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/git/git_url.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/git/zip_download.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/helpers/__init__.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/helpers/cli.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/helpers/modules.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/helpers/modules_git.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/helpers/modules_py.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/helpers/odoo_files.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/helpers/odoo_manifest.py +0 -0
- {godoo_cli-0.11.6 → godoo_cli-0.11.7}/src/godoo_cli/helpers/system.py +0 -0
|
@@ -104,12 +104,15 @@ def is_bootstrapped(
|
|
|
104
104
|
raise typer.Exit(boot.value)
|
|
105
105
|
|
|
106
106
|
|
|
107
|
-
def _get_installed_modules(db_connection: DBConnection):
|
|
108
|
-
"""Get list of installed modules in database"""
|
|
107
|
+
def _get_installed_modules(db_connection: DBConnection, to_install=False):
|
|
108
|
+
"""Get list of installed modules in database (to_install includes the modules marked for installation)"""
|
|
109
109
|
if boot := _is_bootstrapped(db_connection=db_connection) != DB_BOOTSTRAP_STATUS.BOOTSTRAPPED:
|
|
110
110
|
return boot.value
|
|
111
|
+
lookup_states = ["installed", "to upgrade"]
|
|
112
|
+
if to_install:
|
|
113
|
+
lookup_states.append("to install")
|
|
111
114
|
with db_connection.connect() as cursor:
|
|
112
|
-
cursor.execute("SELECT name FROM ir_module_module WHERE state
|
|
115
|
+
cursor.execute("SELECT name FROM ir_module_module WHERE state IN %s;", [tuple(lookup_states)])
|
|
113
116
|
sql_res = cursor.fetchall()
|
|
114
117
|
return [r[0] for r in sql_res]
|
|
115
118
|
|
|
@@ -121,6 +124,11 @@ def get_installed_modules(
|
|
|
121
124
|
db_name=CLI.database.db_name,
|
|
122
125
|
db_user=CLI.database.db_user,
|
|
123
126
|
db_password=CLI.database.db_password,
|
|
127
|
+
to_install: bool = typer.Option(
|
|
128
|
+
False,
|
|
129
|
+
"--to-install",
|
|
130
|
+
help="Include modules marked for installation",
|
|
131
|
+
),
|
|
124
132
|
):
|
|
125
133
|
"""Returns Modules Marked as installed by Odoo in the database"""
|
|
126
134
|
db_connection = DBConnection(
|
|
@@ -130,7 +138,7 @@ def get_installed_modules(
|
|
|
130
138
|
password=db_password,
|
|
131
139
|
db_name=db_name,
|
|
132
140
|
)
|
|
133
|
-
installed_modules = _get_installed_modules(db_connection=db_connection)
|
|
141
|
+
installed_modules = _get_installed_modules(db_connection=db_connection, to_install=to_install)
|
|
134
142
|
if isinstance(installed_modules, int):
|
|
135
143
|
raise typer.Exit(installed_modules)
|
|
136
144
|
for module in sorted(installed_modules):
|
|
@@ -37,11 +37,27 @@ def odoo_shell(
|
|
|
37
37
|
pipe_in_command: str = typer.Argument("", help="Python command, that will be piped into odoo-bin shell"),
|
|
38
38
|
odoo_main_path=CLI.odoo_paths.bin_path,
|
|
39
39
|
odoo_conf_path=CLI.odoo_paths.conf_path,
|
|
40
|
+
db_host=CLI.database.db_host,
|
|
41
|
+
db_port=CLI.database.db_port,
|
|
42
|
+
db_name=CLI.database.db_name,
|
|
43
|
+
db_user=CLI.database.db_user,
|
|
44
|
+
db_password=CLI.database.db_password,
|
|
40
45
|
):
|
|
41
46
|
"""
|
|
42
47
|
Start Odoo session in an Interactive shell.
|
|
48
|
+
|
|
49
|
+
Odoo Conf is Preferred, but if not found, Database Options are used.
|
|
43
50
|
"""
|
|
44
|
-
shell_cmd = f"{str(odoo_main_path.absolute())}/odoo-bin shell
|
|
51
|
+
shell_cmd = f"{str(odoo_main_path.absolute())}/odoo-bin shell --no-http"
|
|
52
|
+
if odoo_conf_path.exists():
|
|
53
|
+
shell_cmd += f" -c {str(odoo_conf_path.absolute())}"
|
|
54
|
+
else:
|
|
55
|
+
LOGGER.warning("No Odoo Config File found at %s", odoo_conf_path)
|
|
56
|
+
if not all([db_host, db_port, db_name, db_user, db_password]):
|
|
57
|
+
LOGGER.error("Missing database options and Config File. Aborting.")
|
|
58
|
+
return CLI.returner(1)
|
|
59
|
+
shell_cmd += f" --db_host={db_host} --db_port={db_port} --database={db_name} --db_user={db_user} --db_password={db_password}"
|
|
60
|
+
|
|
45
61
|
if pipe_in_command:
|
|
46
62
|
pipe_in_command = pipe_in_command.replace('"', '\\"') # Escape Double Quotes
|
|
47
63
|
shell_cmd = f'echo "{pipe_in_command}" |' + shell_cmd
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.11.7"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.11.6"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|