gOdoo-cli 0.11.4__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.
Files changed (51) hide show
  1. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/PKG-INFO +1 -1
  2. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/pyproject.toml +1 -1
  3. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/commands/db/query.py +12 -4
  4. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/commands/rpc/translations.py +1 -1
  5. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/commands/shell.py +17 -1
  6. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/commands/source_get.py +1 -1
  7. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/git/git_odoo.py +8 -0
  8. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/git/git_repo.py +2 -1
  9. godoo_cli-0.11.7/src/godoo_cli/version.py +1 -0
  10. godoo_cli-0.11.4/src/godoo_cli/version.py +0 -1
  11. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/LICENSE +0 -0
  12. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/README.md +0 -0
  13. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/__init__.py +0 -0
  14. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/__main__.py +0 -0
  15. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/cli.py +0 -0
  16. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/cli_common.py +0 -0
  17. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/commands/__init__.py +0 -0
  18. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/commands/backup/__init__.py +0 -0
  19. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/commands/backup/cli.py +0 -0
  20. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/commands/backup/dump.py +0 -0
  21. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/commands/backup/load.py +0 -0
  22. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/commands/backup/pull.py +0 -0
  23. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/commands/backup/util.py +0 -0
  24. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/commands/bootstrap.py +0 -0
  25. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/commands/config.py +0 -0
  26. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/commands/db/__init__.py +0 -0
  27. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/commands/db/cli.py +0 -0
  28. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/commands/db/connection.py +0 -0
  29. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/commands/db/passwords.py +0 -0
  30. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/commands/launch.py +0 -0
  31. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/commands/rpc/__init__.py +0 -0
  32. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/commands/rpc/cli.py +0 -0
  33. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/commands/rpc/config_parameters.py +0 -0
  34. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/commands/rpc/importer.py +0 -0
  35. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/commands/rpc/modules.py +0 -0
  36. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/commands/test/__init__.py +0 -0
  37. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/commands/test/cli.py +0 -0
  38. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/commands/test/test_load_data.py +0 -0
  39. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/commands/test/test_run.py +0 -0
  40. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/git/__init__.py +0 -0
  41. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/git/git_odoo_addons.py +0 -0
  42. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/git/git_url.py +0 -0
  43. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/git/zip_download.py +0 -0
  44. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/helpers/__init__.py +0 -0
  45. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/helpers/cli.py +0 -0
  46. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/helpers/modules.py +0 -0
  47. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/helpers/modules_git.py +0 -0
  48. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/helpers/modules_py.py +0 -0
  49. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/helpers/odoo_files.py +0 -0
  50. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/helpers/odoo_manifest.py +0 -0
  51. {godoo_cli-0.11.4 → godoo_cli-0.11.7}/src/godoo_cli/helpers/system.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: gOdoo-cli
3
- Version: 0.11.4
3
+ Version: 0.11.7
4
4
  Summary: Wrapper around Odoo-Bin with some convinience RPC functions.
5
5
  Home-page: https://github.com/OpenJKSoftware/gOdoo
6
6
  License: LGPL-3
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "gOdoo-cli"
3
- version = "0.11.4"
3
+ version = "0.11.7"
4
4
  description = "Wrapper around Odoo-Bin with some convinience RPC functions."
5
5
  authors = ["Joshua Kreuder <Joshua_Kreuder@outlook.com>"]
6
6
  license = "LGPL-3"
@@ -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 = 'installed';")
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):
@@ -105,7 +105,7 @@ def dump_translations(
105
105
  upgrade_modules: bool = typer.Option(True, help="Upgrade modules before exporting"),
106
106
  ):
107
107
  """Dump Translations of module to <module_folder>/i18n/<module_name>.pot"""
108
- godoo_modules = godooModules(workspace_addon_path).get_modules(modules)
108
+ godoo_modules = list(godooModules(workspace_addon_path).get_modules(modules))
109
109
  module_names = [m.name for m in godoo_modules]
110
110
  LOGGER.debug("Found modules: %s", module_names)
111
111
 
@@ -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 -c {str(odoo_conf_path.absolute())} --no-http"
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
@@ -125,7 +125,7 @@ def py_depends_by_db(
125
125
  )
126
126
  module_list = [m for m in module_list]
127
127
  module_reg = godooModules(odoo_addon_paths)
128
- modules = list(module_reg.get_modules(module_list))
128
+ modules = list(module_reg.get_modules(module_list, raise_missing_names=False))
129
129
  _install_py_reqs_for_modules(modules, module_reg)
130
130
 
131
131
 
@@ -43,4 +43,12 @@ def git_ensure_odoo_repo(
43
43
  single_branch=True,
44
44
  )
45
45
 
46
+ # make sure odoo-bin is executable
47
+ odoo_bin = target_folder / "odoo-bin"
48
+ if odoo_bin.exists():
49
+ LOGGER.debug("chmod odoo-bin +executable")
50
+ odoo_bin.chmod(0o755)
51
+ else:
52
+ LOGGER.warning("Could not find odoo-bin in %s", target_folder)
53
+
46
54
  yaml.dump(git_repos, manifest_file)
@@ -1,4 +1,5 @@
1
1
  """ Module to provide GIT interaction."""
2
+
2
3
  import logging
3
4
  import shutil
4
5
  from pathlib import Path
@@ -64,7 +65,7 @@ def git_pull_checkout_reset(
64
65
  if pull:
65
66
  LOGGER.debug("Pulling Repo: %s, %s", repo.working_dir, pull)
66
67
  try:
67
- repo.remotes[0].pull(pull)
68
+ repo.remotes[0].pull(None if isinstance(pull, bool) else pull)
68
69
  except GitCommandError as e:
69
70
  if "fatal: refusing to merge unrelated histories" in e.stderr:
70
71
  clone_kwargs = {}
@@ -0,0 +1 @@
1
+ __version__ = "0.11.7"
@@ -1 +0,0 @@
1
- __version__ = "0.11.4"
File without changes
File without changes