odoo-dev 0.2.3__tar.gz → 0.2.5__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 (72) hide show
  1. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/.claude/settings.local.json +3 -1
  2. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/PKG-INFO +2 -1
  3. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/pyproject.toml +3 -1
  4. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/src/odoo_dev/__init__.py +1 -1
  5. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/src/odoo_dev/cli.py +1 -0
  6. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/src/odoo_dev/commands/docker.py +14 -4
  7. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/src/odoo_dev/commands/run.py +6 -6
  8. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/src/odoo_dev/commands/setup.py +137 -19
  9. odoo_dev-0.2.5/src/odoo_dev/templates/__init__.py +1 -0
  10. {odoo_dev-0.2.3/tests/fixtures/odoo-empty/.odoo-deploy → odoo_dev-0.2.5/src/odoo_dev/templates/docker}/Dockerfile +6 -4
  11. odoo_dev-0.2.5/src/odoo_dev/templates/docker/__init__.py +1 -0
  12. odoo_dev-0.2.5/src/odoo_dev/templates/vscode/__init__.py +1 -0
  13. {odoo_dev-0.2.3/tests/fixtures/odoo-empty/.odoo-deploy → odoo_dev-0.2.5/src/odoo_dev}/templates/vscode/launch.json +26 -2
  14. {odoo_dev-0.2.3/tests/fixtures/odoo-empty/.odoo-deploy → odoo_dev-0.2.5/src/odoo_dev}/templates/vscode/settings.json +1 -1
  15. {odoo_dev-0.2.3/tests/fixtures/odoo-empty/.odoo-deploy → odoo_dev-0.2.5/src/odoo_dev}/templates/vscode/tasks.json +6 -6
  16. odoo_dev-0.2.5/tests/fixtures/odoo-empty/requirements.txt +0 -0
  17. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/tests/fixtures/odoo-empty/tools/main.py +230 -128
  18. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/tests/fixtures/odoo-empty/tools/pre_commit_hook.py +30 -13
  19. odoo_dev-0.2.5/tests/fixtures/odoo-empty/tools/update_addon_versions.py +24 -0
  20. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/tests/test_db.py +2 -4
  21. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/tests/test_integration.py +32 -5
  22. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/tests/test_run.py +2 -4
  23. odoo_dev-0.2.5/tests/test_setup.py +197 -0
  24. odoo_dev-0.2.5/uv.lock +258 -0
  25. odoo_dev-0.2.3/tests/fixtures/odoo-empty/.gitmodules +0 -5
  26. odoo_dev-0.2.3/tests/fixtures/odoo-empty/.odoo-deploy/.git +0 -1
  27. odoo_dev-0.2.3/tests/fixtures/odoo-empty/.odoo-deploy/.gitignore +0 -6
  28. odoo_dev-0.2.3/tests/fixtures/odoo-empty/.odoo-deploy/Makefile +0 -21
  29. odoo_dev-0.2.3/tests/fixtures/odoo-empty/.odoo-deploy/README.md +0 -194
  30. odoo_dev-0.2.3/tests/fixtures/odoo-empty/.odoo-deploy/compose.yaml +0 -53
  31. odoo_dev-0.2.3/tests/fixtures/odoo-empty/.odoo-deploy/install.sh +0 -84
  32. odoo_dev-0.2.3/tests/fixtures/odoo-empty/.odoo-deploy/odoo-dev.sh +0 -1280
  33. odoo_dev-0.2.3/tests/fixtures/odoo-empty/.odoo-deploy/templates/odoo.conf +0 -22
  34. odoo_dev-0.2.3/tests/fixtures/odoo-empty/.odoo-deploy/uninstall.sh +0 -52
  35. odoo_dev-0.2.3/tests/fixtures/odoo-empty/tools/update_addon_versions.py +0 -23
  36. odoo_dev-0.2.3/tests/test_setup.py +0 -53
  37. odoo_dev-0.2.3/uv.lock +0 -166
  38. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/.gitignore +0 -0
  39. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/.gitmodules +0 -0
  40. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/.python-version +0 -0
  41. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/README.md +0 -0
  42. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/src/odoo_dev/commands/__init__.py +0 -0
  43. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/src/odoo_dev/commands/db.py +0 -0
  44. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/src/odoo_dev/config.py +0 -0
  45. {odoo_dev-0.2.3/tests/fixtures/odoo-empty/.odoo-deploy → odoo_dev-0.2.5/src/odoo_dev/templates/docker}/docker-entrypoint.sh +0 -0
  46. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/src/odoo_dev/utils/__init__.py +0 -0
  47. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/src/odoo_dev/utils/console.py +0 -0
  48. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/tests/__init__.py +0 -0
  49. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/tests/fixtures/__init__.py +0 -0
  50. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/tests/fixtures/odoo-empty/.git +0 -0
  51. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/tests/fixtures/odoo-empty/.gitignore +0 -0
  52. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/tests/fixtures/odoo-empty/.gitlab-ci.yml +0 -0
  53. /odoo_dev-0.2.3/tests/fixtures/odoo-empty/.repos/.gitkeep → /odoo_dev-0.2.5/tests/fixtures/odoo-empty/.gitmodules +0 -0
  54. {odoo_dev-0.2.3/tests/fixtures/odoo-empty/addons → odoo_dev-0.2.5/tests/fixtures/odoo-empty/.repos}/.gitkeep +0 -0
  55. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/tests/fixtures/odoo-empty/Notes/Warning Upgrade all +0 -0
  56. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/tests/fixtures/odoo-empty/README.md +0 -0
  57. /odoo_dev-0.2.3/tests/fixtures/odoo-empty/requirements.txt → /odoo_dev-0.2.5/tests/fixtures/odoo-empty/addons/.gitkeep +0 -0
  58. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/tests/fixtures/odoo-empty/note.txt +0 -0
  59. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/tests/fixtures/odoo-empty/tools/abstorelsymlink.sh +0 -0
  60. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/tests/fixtures/odoo-empty/tools/adaptation.md +0 -0
  61. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/tests/fixtures/odoo-empty/tools/after_migration.sh +0 -0
  62. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/tests/fixtures/odoo-empty/tools/checkout2 +0 -0
  63. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/tests/fixtures/odoo-empty/tools/cleanup.sql +0 -0
  64. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/tests/fixtures/odoo-empty/tools/deploy +0 -0
  65. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/tests/fixtures/odoo-empty/tools/fix_mail_templates.sql +0 -0
  66. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/tests/fixtures/odoo-empty/tools/gitpull +0 -0
  67. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/tests/fixtures/odoo-empty/tools/modules_cleanup.sql +0 -0
  68. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/tests/fixtures/odoo-empty/tools/post-upgrade steps.md +0 -0
  69. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/tests/fixtures/odoo-empty/tools/requirements.txt +0 -0
  70. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/tests/fixtures/odoo-empty/tools/test +0 -0
  71. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/tests/test_cli.py +0 -0
  72. {odoo_dev-0.2.3 → odoo_dev-0.2.5}/tests/test_config.py +0 -0
@@ -2,7 +2,9 @@
2
2
  "permissions": {
3
3
  "allow": [
4
4
  "Bash(git add:*)",
5
- "Bash(git commit -m \"$\\(cat <<''EOF''\nAdd project URLs and bump version to 0.2.2\n\nAdd repository links to PyPI package page.\nEOF\n\\)\")"
5
+ "Bash(git commit -m \"$\\(cat <<''EOF''\nAdd project URLs and bump version to 0.2.2\n\nAdd repository links to PyPI package page.\nEOF\n\\)\")",
6
+ "Bash(ls:*)",
7
+ "Bash(xargs:*)"
6
8
  ]
7
9
  }
8
10
  }
@@ -1,10 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: odoo-dev
3
- Version: 0.2.3
3
+ Version: 0.2.5
4
4
  Summary: Odoo Development Environment Helper
5
5
  Project-URL: Homepage, https://git.bemade.org/bemade/odoo-dev
6
6
  Project-URL: Repository, https://git.bemade.org/bemade/odoo-dev
7
7
  Project-URL: Issues, https://git.bemade.org/bemade/odoo-dev/-/issues
8
+ License-Expression: LGPL-3.0
8
9
  Requires-Python: >=3.12
9
10
  Requires-Dist: rich>=13.0.0
10
11
  Requires-Dist: typer>=0.9.0
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "odoo-dev"
3
- version = "0.2.3"
3
+ version = "0.2.5"
4
4
  description = "Odoo Development Environment Helper"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -8,6 +8,7 @@ dependencies = [
8
8
  "typer>=0.9.0",
9
9
  "rich>=13.0.0",
10
10
  ]
11
+ license = "LGPL-3.0"
11
12
 
12
13
  [project.urls]
13
14
  Homepage = "https://git.bemade.org/bemade/odoo-dev"
@@ -20,6 +21,7 @@ odoo-dev = "odoo_dev.cli:app"
20
21
  [dependency-groups]
21
22
  dev = [
22
23
  "pytest>=8.0.0",
24
+ "black",
23
25
  ]
24
26
 
25
27
  [tool.pytest.ini_options]
@@ -1,3 +1,3 @@
1
1
  """Odoo Development Environment Helper."""
2
2
 
3
- __version__ = "0.2.3"
3
+ __version__ = "0.2.5"
@@ -35,6 +35,7 @@ def _main(
35
35
  """Odoo Development Environment Helper."""
36
36
  pass
37
37
 
38
+
38
39
  # Command groups
39
40
  app.add_typer(db.app, name="db")
40
41
  app.add_typer(docker.app, name="docker")
@@ -71,6 +71,7 @@ def build(
71
71
  ),
72
72
  ) -> None:
73
73
  """Rebuild the Odoo Docker image."""
74
+ import importlib.resources
74
75
  import shutil
75
76
 
76
77
  cfg = load_config()
@@ -81,10 +82,19 @@ def build(
81
82
  build_context.mkdir(parents=True, exist_ok=True)
82
83
 
83
84
  try:
84
- # Copy necessary files to build context
85
- shutil.copy(cfg.script_dir / "Dockerfile", build_context)
86
- shutil.copy(cfg.script_dir / "docker-entrypoint.sh", build_context)
87
- shutil.copy(cfg.docker_config_file, build_context / "odoo.conf")
85
+ # Write Docker templates directly to build context from package
86
+ templates = importlib.resources.files("odoo_dev.templates.docker")
87
+ for filename in ["Dockerfile", "docker-entrypoint.sh"]:
88
+ (build_context / filename).write_text(
89
+ templates.joinpath(filename).read_text()
90
+ )
91
+
92
+ # Generate Docker odoo.conf
93
+ from odoo_dev.commands.setup import _generate_docker_odoo_conf
94
+
95
+ (build_context / "odoo.conf").write_text(
96
+ _generate_docker_odoo_conf(community_only=community)
97
+ )
88
98
 
89
99
  # Copy requirements files
90
100
  if (cfg.project_dir / "requirements.txt").exists():
@@ -17,10 +17,12 @@ def run(
17
17
  str | None, typer.Option("-d", "--database", help="Database name")
18
18
  ] = None,
19
19
  install: Annotated[
20
- str | None, typer.Option("-i", "--init", help="Modules to install (comma-separated)")
20
+ str | None,
21
+ typer.Option("-i", "--init", help="Modules to install (comma-separated)"),
21
22
  ] = None,
22
23
  update: Annotated[
23
- str | None, typer.Option("-u", "--update", help="Modules to update (comma-separated)")
24
+ str | None,
25
+ typer.Option("-u", "--update", help="Modules to update (comma-separated)"),
24
26
  ] = None,
25
27
  dev: Annotated[
26
28
  str | None,
@@ -29,9 +31,7 @@ def run(
29
31
  debug: Annotated[
30
32
  bool, typer.Option("--debug", help="Enable debugpy for VSCode debugging")
31
33
  ] = False,
32
- port: Annotated[
33
- int, typer.Option("-p", "--port", help="HTTP port")
34
- ] = 8069,
34
+ port: Annotated[int, typer.Option("-p", "--port", help="HTTP port")] = 8069,
35
35
  ) -> None:
36
36
  """Run Odoo locally."""
37
37
  cfg = load_config()
@@ -352,9 +352,9 @@ def test(
352
352
  [
353
353
  str(venv_python),
354
354
  str(cfg.odoo_bin),
355
- "db",
356
355
  "-c",
357
356
  str(cfg.config_file),
357
+ "db",
358
358
  "drop",
359
359
  db_name,
360
360
  ],
@@ -1,6 +1,8 @@
1
1
  """Setup commands for initializing Odoo development environment."""
2
2
 
3
+ import importlib.resources
3
4
  import os
5
+ import shutil
4
6
  import subprocess
5
7
  from pathlib import Path
6
8
 
@@ -75,12 +77,27 @@ def _update_env_file(env_file: Path, updates: dict[str, str]) -> None:
75
77
  env_file.write_text(content + "\n")
76
78
 
77
79
 
80
+ def _clean():
81
+ cfg = load_config()
82
+ success("Cleaning up current environment...")
83
+ for name in ["odoo", "enterprise", "design-themes", "industry", ".venv"]:
84
+ path = cfg.project_dir / name
85
+ if path.exists():
86
+ shutil.rmtree(path)
87
+ success("Clean up complete.")
88
+
89
+
78
90
  def setup(
79
91
  community: bool = typer.Option(
80
92
  False,
81
93
  "--community",
82
94
  help="Set up Community edition only (skip Enterprise repos)",
83
95
  ),
96
+ clean: bool = typer.Option(
97
+ False,
98
+ "--clean",
99
+ help="Clean up before setup (remove existing venv, etc.)",
100
+ ),
84
101
  ) -> None:
85
102
  """Complete setup: clone Odoo repos, configure VSCode, build image."""
86
103
  # Prompt for versions if not configured
@@ -88,6 +105,8 @@ def setup(
88
105
 
89
106
  cfg = load_config()
90
107
 
108
+ if clean:
109
+ _clean()
91
110
  success("Setting up complete Odoo development environment...")
92
111
 
93
112
  # Initialize/update git submodules first
@@ -112,6 +131,9 @@ def setup(
112
131
  # Prompt for Docker setup
113
132
  warning("\nDo you want to set up the Docker environment?")
114
133
  if typer.confirm("Continue with Docker setup?", default=True):
134
+ # Set up Docker files first
135
+ _setup_docker_files(cfg, community_only=community)
136
+
115
137
  success("\nBuilding Docker image...")
116
138
  from odoo_dev.commands.docker import build
117
139
 
@@ -207,25 +229,23 @@ def vscode(cfg=None) -> None:
207
229
  vscode_dir = cfg.project_dir / ".vscode"
208
230
  vscode_dir.mkdir(exist_ok=True)
209
231
 
210
- template_dir = cfg.script_dir / "templates" / "vscode"
232
+ # Get the templates directory from the package
233
+ templates = importlib.resources.files("odoo_dev.templates.vscode")
211
234
 
212
235
  # Copy template files
213
- import shutil
214
-
215
236
  for template_file in ["launch.json", "tasks.json"]:
216
- src = template_dir / template_file
237
+ template_content = templates.joinpath(template_file).read_text()
217
238
  dst = vscode_dir / template_file
218
- if src.exists():
219
- shutil.copy(src, dst)
220
- success(f"Copied {template_file}")
239
+ dst.write_text(template_content)
240
+ success(f"Copied {template_file}")
221
241
 
222
242
  # Only copy settings.json if it doesn't exist
223
- settings_src = template_dir / "settings.json"
224
243
  settings_dst = vscode_dir / "settings.json"
225
- if settings_src.exists() and not settings_dst.exists():
226
- shutil.copy(settings_src, settings_dst)
244
+ if not settings_dst.exists():
245
+ settings_content = templates.joinpath("settings.json").read_text()
246
+ settings_dst.write_text(settings_content)
227
247
  success("Copied settings.json")
228
- elif settings_dst.exists():
248
+ else:
229
249
  warning("settings.json already exists. Skipping.")
230
250
 
231
251
  success("VSCode configuration set up successfully!")
@@ -298,6 +318,85 @@ db_password = odoo
298
318
  success(f"Config file created at {conf_file}")
299
319
 
300
320
 
321
+ def _setup_docker_files(cfg, community_only: bool = False) -> None:
322
+ """Copy Docker templates to .odoo-deploy directory."""
323
+ success("Setting up Docker files...")
324
+
325
+ # Create .odoo-deploy directory
326
+ cfg.script_dir.mkdir(exist_ok=True)
327
+
328
+ # Get the templates directory from the package
329
+ templates = importlib.resources.files("odoo_dev.templates.docker")
330
+
331
+ # Copy Dockerfile and docker-entrypoint.sh
332
+ for filename in ["Dockerfile", "docker-entrypoint.sh"]:
333
+ template_content = templates.joinpath(filename).read_text()
334
+ dest = cfg.script_dir / filename
335
+ dest.write_text(template_content)
336
+ if filename.endswith(".sh"):
337
+ dest.chmod(0o755)
338
+ success(f"Copied {filename}")
339
+
340
+ # Create Docker odoo.conf
341
+ _setup_docker_odoo_config(cfg, community_only=community_only)
342
+
343
+
344
+ def _generate_docker_odoo_conf(community_only: bool = False) -> str:
345
+ """Generate Docker-specific odoo.conf content."""
346
+ # Build addons path for Docker (using /opt/project paths)
347
+ addons_paths = [
348
+ "/opt/project/odoo/addons",
349
+ "/opt/project/odoo/odoo/addons",
350
+ ]
351
+
352
+ if not community_only:
353
+ addons_paths.append("/opt/project/enterprise")
354
+
355
+ addons_paths.extend(
356
+ [
357
+ "/opt/project/design-themes",
358
+ "/opt/project/industry",
359
+ "/opt/project/addons",
360
+ ]
361
+ )
362
+
363
+ return f"""[options]
364
+ addons_path = {",".join(addons_paths)}
365
+ admin_passwd = admin
366
+ db_host = db
367
+ db_port = 5432
368
+ db_user = odoo
369
+ db_password = odoo
370
+ http_port = 8069
371
+ gevent_port = 8072
372
+ proxy_mode = True
373
+ dev_mode = True
374
+ log_level = info
375
+ list_db = True
376
+ limit_memory_hard = 0
377
+ limit_memory_soft = 2147483648
378
+ limit_time_cpu = 600
379
+ limit_time_real = 1200
380
+ workers = 0
381
+ max_cron_threads = 1
382
+ data_dir = /opt/odoo-filestore
383
+ """
384
+
385
+
386
+ def _setup_docker_odoo_config(cfg, community_only: bool = False) -> None:
387
+ """Create Docker-specific odoo.conf configuration file."""
388
+ conf_file = cfg.docker_config_file
389
+
390
+ if conf_file.exists():
391
+ warning(f"Docker config file already exists at {conf_file}")
392
+ return
393
+
394
+ success("Creating Docker Odoo configuration file...")
395
+ conf_file.write_text(_generate_docker_odoo_conf(community_only=community_only))
396
+ conf_file.chmod(0o600)
397
+ success(f"Docker config file created at {conf_file}")
398
+
399
+
301
400
  def _clone_odoo_repos(cfg, community_only: bool = False) -> None:
302
401
  """Clone or update Odoo repositories."""
303
402
  success("Setting up Odoo repositories...")
@@ -305,22 +404,25 @@ def _clone_odoo_repos(cfg, community_only: bool = False) -> None:
305
404
  if community_only:
306
405
  warning("Community edition mode: Enterprise repositories will be skipped")
307
406
 
407
+ # Use HTTPS for odoo (public), SSH for all others (private)
308
408
  repos = [
309
- (f"git@github.com:odoo/odoo.git", "odoo", cfg.odoo_version),
310
- (f"git@github.com:odoo/design-themes.git", "design-themes", cfg.odoo_version),
409
+ ("https://github.com/odoo/odoo.git", "odoo", cfg.odoo_version),
311
410
  ]
312
411
 
313
- # Add enterprise if not community only
412
+ # Private repos require SSH
413
+ repos.append(
414
+ ("git@github.com:odoo/design-themes.git", "design-themes", cfg.odoo_version)
415
+ )
416
+
417
+ # Add enterprise if not community only (private repo, needs SSH)
314
418
  if not community_only:
315
419
  repos.append(
316
- (f"git@github.com:odoo/enterprise.git", "enterprise", cfg.odoo_version)
420
+ ("git@github.com:odoo/enterprise.git", "enterprise", cfg.odoo_version)
317
421
  )
318
422
 
319
- # Add industry for Odoo 18+
423
+ # Add industry for Odoo 18+ (private repo)
320
424
  if cfg.odoo_version.startswith("18") or cfg.odoo_version.startswith("19"):
321
- repos.append(
322
- (f"git@github.com:odoo/industry.git", "industry", cfg.odoo_version)
323
- )
425
+ repos.append(("git@github.com:odoo/industry.git", "industry", cfg.odoo_version))
324
426
 
325
427
  for repo_url, repo_dir, branch in repos:
326
428
  repo_path = cfg.project_dir / repo_dir
@@ -355,6 +457,15 @@ def _clone_odoo_repos(cfg, community_only: bool = False) -> None:
355
457
  success("Odoo repositories setup complete.")
356
458
 
357
459
 
460
+ def _can_sudo_without_password() -> bool:
461
+ """Check if sudo can run without prompting for password."""
462
+ result = subprocess.run(
463
+ ["sudo", "-n", "true"],
464
+ capture_output=True,
465
+ )
466
+ return result.returncode == 0
467
+
468
+
358
469
  def _install_system_dependencies() -> None:
359
470
  """Install system dependencies based on OS."""
360
471
  import platform
@@ -376,6 +487,13 @@ def _install_system_dependencies() -> None:
376
487
  check=False,
377
488
  )
378
489
  elif system == "Linux":
490
+ if not _can_sudo_without_password():
491
+ warning(
492
+ "Cannot run sudo without password. "
493
+ "Please install system dependencies manually or run with sudo."
494
+ )
495
+ return
496
+
379
497
  success("Installing dependencies for Linux...")
380
498
  subprocess.run(
381
499
  [
@@ -0,0 +1 @@
1
+ # Templates package for odoo-dev
@@ -3,6 +3,9 @@ FROM python:${PYTHON_VERSION}-slim-bookworm
3
3
 
4
4
  ARG ODOO_VERSION=17.0
5
5
 
6
+ # Install uv for fast package management
7
+ COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
8
+
6
9
  # Install system dependencies
7
10
  RUN apt-get update && apt-get install -y --no-install-recommends \
8
11
  build-essential \
@@ -20,7 +23,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
20
23
  npm \
21
24
  python3-num2words \
22
25
  python3-pdfminer \
23
- python3-pip \
24
26
  python3-phonenumbers \
25
27
  python3-pyldap \
26
28
  python3-qrcode \
@@ -43,7 +45,7 @@ RUN curl -o wkhtmltox.deb -sSL https://github.com/wkhtmltopdf/packaging/releases
43
45
  && rm -rf /var/lib/apt/lists/* wkhtmltox.deb
44
46
 
45
47
  # Install debugpy
46
- RUN pip install --no-cache-dir --break-system-packages debugpy
48
+ RUN uv pip install --system --no-cache debugpy
47
49
 
48
50
  # Create odoo user and directories
49
51
  RUN useradd -ms /bin/bash -d /opt/odoo odoo && \
@@ -60,8 +62,8 @@ COPY odoo-requirements.txt /tmp/odoo-requirements.txt
60
62
  COPY requirements.txt /tmp/requirements.txt
61
63
 
62
64
  # Install Python dependencies
63
- RUN pip install --no-cache-dir --break-system-packages -r /tmp/odoo-requirements.txt
64
- RUN pip install --no-cache-dir --break-system-packages -r /tmp/requirements.txt
65
+ RUN uv pip install --system --no-cache -r /tmp/odoo-requirements.txt
66
+ RUN uv pip install --system --no-cache -r /tmp/requirements.txt
65
67
 
66
68
  # Copy entrypoint script
67
69
  COPY ./docker-entrypoint.sh /
@@ -0,0 +1 @@
1
+ # Docker templates package
@@ -0,0 +1 @@
1
+ # VSCode templates package
@@ -29,7 +29,7 @@
29
29
  "console": "integratedTerminal",
30
30
  "args": [
31
31
  "-c",
32
- "${workspaceFolder}/conf/odoo.conf",
32
+ "${workspaceFolder}/conf/odoo.conf"
33
33
  ],
34
34
  "env": {
35
35
  "PYTHONWARNINGS": "ignore:FutureWarning",
@@ -57,6 +57,30 @@
57
57
  "GEVENT_SUPPORT": "True"
58
58
  }
59
59
  },
60
+ {
61
+ "name": "Odoo Local: Integration Test",
62
+ "type": "debugpy",
63
+ "request": "launch",
64
+ "program": "${workspaceFolder}/odoo/odoo-bin",
65
+ "console": "integratedTerminal",
66
+ "args": [
67
+ "-c",
68
+ "${workspaceFolder}/conf/odoo.conf",
69
+ "-u",
70
+ "${input:modules}",
71
+ "-i",
72
+ "${input:modules}",
73
+ "--test-enable",
74
+ "-d",
75
+ "${input:database}",
76
+ "--stop-after-init",
77
+ "--no-http"
78
+ ],
79
+ "env": {
80
+ "PYTHONWARNINGS": "ignore:FutureWarning",
81
+ "GEVENT_SUPPORT": "True"
82
+ }
83
+ },
60
84
  {
61
85
  "name": "Odoo Local: Test",
62
86
  "type": "debugpy",
@@ -181,4 +205,4 @@
181
205
  "justMyCode": false
182
206
  }
183
207
  ]
184
- }
208
+ }
@@ -1,5 +1,5 @@
1
1
  {
2
- "python.defaultInterpreterPath": "${workspaceFolder}/venv/bin/python",
2
+ "python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
3
3
  "python": {
4
4
  "editor.defaultFormatter": "ms-python.black-formatter",
5
5
  "editor.formatOnSave": true,
@@ -4,7 +4,7 @@
4
4
  {
5
5
  "label": "Update Module",
6
6
  "type": "shell",
7
- "command": "cd ${workspaceFolder}/.odoo-deploy && ./odoo-dev.sh update ${input:moduleName}",
7
+ "command": "odoo-dev docker restart",
8
8
  "presentation": {
9
9
  "reveal": "always",
10
10
  "panel": "new"
@@ -13,7 +13,7 @@
13
13
  {
14
14
  "label": "Start Odoo Shell",
15
15
  "type": "shell",
16
- "command": "cd ${workspaceFolder}/.odoo-deploy && ./odoo-dev.sh shell",
16
+ "command": "odoo-dev docker shell ${input:database}",
17
17
  "presentation": {
18
18
  "reveal": "always",
19
19
  "panel": "new"
@@ -22,7 +22,7 @@
22
22
  {
23
23
  "label": "Restart Odoo",
24
24
  "type": "shell",
25
- "command": "cd ${workspaceFolder}/.odoo-deploy && ./odoo-dev.sh restart",
25
+ "command": "odoo-dev docker restart",
26
26
  "presentation": {
27
27
  "reveal": "always",
28
28
  "panel": "new"
@@ -31,9 +31,9 @@
31
31
  ],
32
32
  "inputs": [
33
33
  {
34
- "id": "moduleName",
35
- "description": "Module name to update (comma-separated for multiple, or 'all')",
36
- "default": "all",
34
+ "id": "database",
35
+ "description": "Database name",
36
+ "default": "",
37
37
  "type": "promptString"
38
38
  }
39
39
  ]