odoo-devops-tools 1.25.2__tar.gz → 1.25.4__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: odoo-devops-tools
3
- Version: 1.25.2
3
+ Version: 1.25.4
4
4
  Summary: Build reproducible Odoo workspaces from a single project definition.
5
5
  Author: Roman Lacko
6
6
  License-Expression: MIT
@@ -145,8 +145,8 @@ Add-Content -Path $PROFILE -Value 'odoo-compose-venv completion powershell | Out
145
145
  ```
146
146
 
147
147
  Restart your shell or reload its configuration to activate completion. For example,
148
- `odoo-compose setup --sy<TAB>` suggests matching options such as `--sync-odoo`,
149
- `--sync-addons`, and `--sync-all`.
148
+ `odoo-compose setup --sy<TAB>` suggests matching options such as `--sync`,
149
+ `--sync-odoo`, `--sync-addons`, and `--sync-all`.
150
150
 
151
151
  ---
152
152
 
@@ -216,7 +216,7 @@ branch = ${odoo:version}
216
216
  Sync the addon repositories and regenerate the Docker environment:
217
217
 
218
218
  ```bash
219
- odoo-compose setup --sync-addons
219
+ odoo-compose setup --sync
220
220
  odoo-compose up --build
221
221
  ```
222
222
 
@@ -255,7 +255,7 @@ odoo_source = workspace
255
255
  Sync the Odoo source and generate the Docker artifacts:
256
256
 
257
257
  ```bash
258
- odoo-compose setup --sync-all
258
+ odoo-compose setup --sync
259
259
  odoo-compose up --build
260
260
  ```
261
261
 
@@ -329,13 +329,13 @@ Use `--create-docker-deploy` to generate a self-contained Docker build context f
329
329
  Addon modules are staged into the build context so the resulting image does not depend on bind-mounted workspace sources:
330
330
 
331
331
  ```bash
332
- odoo-compose setup --sync-addons --create-docker-deploy
332
+ odoo-compose setup --sync --create-docker-deploy
333
333
  ```
334
334
 
335
335
  When `[docker].odoo_source = workspace`, sync the Odoo source as well:
336
336
 
337
337
  ```bash
338
- odoo-compose setup --sync-all --create-docker-deploy
338
+ odoo-compose setup --sync --create-docker-deploy
339
339
  ```
340
340
 
341
341
  This additionally creates:
@@ -364,7 +364,7 @@ In this workflow, Odoo runs directly on the host using a generated Python virtua
364
364
  Create the workspace with the Odoo source and virtual environment:
365
365
 
366
366
  ```bash
367
- odoo-compose-venv setup ./odoo19 --sync-all --create-venv \
367
+ odoo-compose-venv setup ./odoo19 --sync --create-venv \
368
368
  --set config:db_host=127.0.0.1 \
369
369
  --set config:db_name=odoo \
370
370
  --set config:db_user=odoo \
@@ -423,7 +423,7 @@ branch = ${odoo:version}
423
423
  Sync the addon repositories and recreate the Python environment to include their dependencies:
424
424
 
425
425
  ```bash
426
- odoo-compose-venv setup --sync-all --create-venv
426
+ odoo-compose-venv setup --sync --create-venv
427
427
  ```
428
428
 
429
429
  The repositories are cloned into `ROOT/odoo-addons/` and automatically added to the generated `addons_path`. Python dependencies from their `requirements.txt` files are included in the virtual environment.
@@ -467,7 +467,7 @@ python_version = 3.11
467
467
  After changing the project file, run `odoo-compose` again from the workspace root:
468
468
 
469
469
  ```bash
470
- odoo-compose-venv setup --sync-all --create-venv
470
+ odoo-compose-venv setup --sync --create-venv
471
471
  ```
472
472
 
473
473
  This recreates the virtual environment at `ROOT/venv` using the system Python.
@@ -557,7 +557,7 @@ Those machine-specific outputs are recreated on the target machine.
557
557
  On an internet-connected build machine, sync the sources, build the wheelhouse, and create the bundle in one command:
558
558
 
559
559
  ```bash
560
- odoo-compose-venv setup --sync-all --create-venv --create-bundle
560
+ odoo-compose-venv setup --sync --create-venv --create-bundle
561
561
  ```
562
562
 
563
563
  When no output path is supplied, the bundle is written to:
@@ -569,7 +569,7 @@ ROOT/dist/ROOT-NAME.odt.zip
569
569
  You can also select an explicit output file:
570
570
 
571
571
  ```bash
572
- odoo-compose-venv setup --sync-all --create-venv --create-bundle ./artifacts/odoo18-production.odt.zip
572
+ odoo-compose-venv setup --sync --create-venv --create-bundle ./artifacts/odoo18-production.odt.zip
573
573
  ```
574
574
 
575
575
  #### 4.1.1. Including uncommitted changes
@@ -579,7 +579,7 @@ By default, bundle creation stops when a bundled Git repository has uncommitted
579
579
  To intentionally include those changes in the bundle, use:
580
580
 
581
581
  ```bash
582
- odoo-compose-venv setup --sync-all --create-venv --create-bundle --allow-dirty-bundle
582
+ odoo-compose-venv setup --sync --create-venv --create-bundle --allow-dirty-bundle
583
583
  ```
584
584
 
585
585
  ### 4.2. Create the workspace on the target machine
@@ -776,6 +776,9 @@ Git source syntax: `git+REPO_URL//PATH/TO/PROJECT.ini?ref=REF`.
776
776
  **Repository synchronization**
777
777
 
778
778
  <dl class="cli-reference">
779
+ <dt><code>--sync</code></dt>
780
+ <dd><p>Automatically synchronize only the Git sources used by the selected workflow. In Docker, Odoo is synced only with <code>[docker].odoo_source = workspace</code>; in Venv, Git-managed Odoo is synced. Both workflows sync configured Git addons.</p></dd>
781
+
779
782
  <dt><code>--sync-odoo</code></dt>
780
783
  <dd><p>Sync Git-managed Odoo sources; reuse <code>[odoo].path</code> without Git sync when a local path is configured.</p></dd>
781
784
 
@@ -783,10 +786,10 @@ Git source syntax: `git+REPO_URL//PATH/TO/PROJECT.ini?ref=REF`.
783
786
  <dd><p>Sync Git-managed addons into <code>ROOT/odoo-addons/</code>.</p></dd>
784
787
 
785
788
  <dt><code>--sync-all</code></dt>
786
- <dd><p>Sync both Odoo and addons.</p></dd>
789
+ <dd><p>Explicitly select both Odoo and addon sources, regardless of the selected workflow. Unlike <code>--sync</code>, this can fetch Odoo sources even when Docker runs Odoo from the base image.</p></dd>
787
790
 
788
791
  > **Note:**
789
- > Repository sync aborts if a target Git repository has uncommitted changes. Commit, stash or discard changes before syncing.
792
+ > Repository sync aborts if a target Git repository has uncommitted changes **or a local branch contains commits absent from the remote branch**. Commit/stash uncommitted changes or push/reconcile unpublished commits before syncing. The four sync switches are mutually exclusive; without any of them, <code>setup</code> only regenerates artifacts and does not fetch repositories.
790
793
 
791
794
  </dl>
792
795
 
@@ -829,7 +832,7 @@ odoo-compose setup ./odoo19
829
832
  odoo-compose setup ./odoo18 --set odoo:version=18.0
830
833
 
831
834
  # Native workflow:
832
- odoo-compose-venv setup ./odoo19 --sync-all --create-venv
835
+ odoo-compose-venv setup ./odoo19 --sync --create-venv
833
836
  odoo-compose-venv setup ./odoo18 --set odoo:version=18.0 --sync-all --create-venv
834
837
  ```
835
838
 
@@ -117,8 +117,8 @@ Add-Content -Path $PROFILE -Value 'odoo-compose-venv completion powershell | Out
117
117
  ```
118
118
 
119
119
  Restart your shell or reload its configuration to activate completion. For example,
120
- `odoo-compose setup --sy<TAB>` suggests matching options such as `--sync-odoo`,
121
- `--sync-addons`, and `--sync-all`.
120
+ `odoo-compose setup --sy<TAB>` suggests matching options such as `--sync`,
121
+ `--sync-odoo`, `--sync-addons`, and `--sync-all`.
122
122
 
123
123
  ---
124
124
 
@@ -188,7 +188,7 @@ branch = ${odoo:version}
188
188
  Sync the addon repositories and regenerate the Docker environment:
189
189
 
190
190
  ```bash
191
- odoo-compose setup --sync-addons
191
+ odoo-compose setup --sync
192
192
  odoo-compose up --build
193
193
  ```
194
194
 
@@ -227,7 +227,7 @@ odoo_source = workspace
227
227
  Sync the Odoo source and generate the Docker artifacts:
228
228
 
229
229
  ```bash
230
- odoo-compose setup --sync-all
230
+ odoo-compose setup --sync
231
231
  odoo-compose up --build
232
232
  ```
233
233
 
@@ -301,13 +301,13 @@ Use `--create-docker-deploy` to generate a self-contained Docker build context f
301
301
  Addon modules are staged into the build context so the resulting image does not depend on bind-mounted workspace sources:
302
302
 
303
303
  ```bash
304
- odoo-compose setup --sync-addons --create-docker-deploy
304
+ odoo-compose setup --sync --create-docker-deploy
305
305
  ```
306
306
 
307
307
  When `[docker].odoo_source = workspace`, sync the Odoo source as well:
308
308
 
309
309
  ```bash
310
- odoo-compose setup --sync-all --create-docker-deploy
310
+ odoo-compose setup --sync --create-docker-deploy
311
311
  ```
312
312
 
313
313
  This additionally creates:
@@ -336,7 +336,7 @@ In this workflow, Odoo runs directly on the host using a generated Python virtua
336
336
  Create the workspace with the Odoo source and virtual environment:
337
337
 
338
338
  ```bash
339
- odoo-compose-venv setup ./odoo19 --sync-all --create-venv \
339
+ odoo-compose-venv setup ./odoo19 --sync --create-venv \
340
340
  --set config:db_host=127.0.0.1 \
341
341
  --set config:db_name=odoo \
342
342
  --set config:db_user=odoo \
@@ -395,7 +395,7 @@ branch = ${odoo:version}
395
395
  Sync the addon repositories and recreate the Python environment to include their dependencies:
396
396
 
397
397
  ```bash
398
- odoo-compose-venv setup --sync-all --create-venv
398
+ odoo-compose-venv setup --sync --create-venv
399
399
  ```
400
400
 
401
401
  The repositories are cloned into `ROOT/odoo-addons/` and automatically added to the generated `addons_path`. Python dependencies from their `requirements.txt` files are included in the virtual environment.
@@ -439,7 +439,7 @@ python_version = 3.11
439
439
  After changing the project file, run `odoo-compose` again from the workspace root:
440
440
 
441
441
  ```bash
442
- odoo-compose-venv setup --sync-all --create-venv
442
+ odoo-compose-venv setup --sync --create-venv
443
443
  ```
444
444
 
445
445
  This recreates the virtual environment at `ROOT/venv` using the system Python.
@@ -529,7 +529,7 @@ Those machine-specific outputs are recreated on the target machine.
529
529
  On an internet-connected build machine, sync the sources, build the wheelhouse, and create the bundle in one command:
530
530
 
531
531
  ```bash
532
- odoo-compose-venv setup --sync-all --create-venv --create-bundle
532
+ odoo-compose-venv setup --sync --create-venv --create-bundle
533
533
  ```
534
534
 
535
535
  When no output path is supplied, the bundle is written to:
@@ -541,7 +541,7 @@ ROOT/dist/ROOT-NAME.odt.zip
541
541
  You can also select an explicit output file:
542
542
 
543
543
  ```bash
544
- odoo-compose-venv setup --sync-all --create-venv --create-bundle ./artifacts/odoo18-production.odt.zip
544
+ odoo-compose-venv setup --sync --create-venv --create-bundle ./artifacts/odoo18-production.odt.zip
545
545
  ```
546
546
 
547
547
  #### 4.1.1. Including uncommitted changes
@@ -551,7 +551,7 @@ By default, bundle creation stops when a bundled Git repository has uncommitted
551
551
  To intentionally include those changes in the bundle, use:
552
552
 
553
553
  ```bash
554
- odoo-compose-venv setup --sync-all --create-venv --create-bundle --allow-dirty-bundle
554
+ odoo-compose-venv setup --sync --create-venv --create-bundle --allow-dirty-bundle
555
555
  ```
556
556
 
557
557
  ### 4.2. Create the workspace on the target machine
@@ -748,6 +748,9 @@ Git source syntax: `git+REPO_URL//PATH/TO/PROJECT.ini?ref=REF`.
748
748
  **Repository synchronization**
749
749
 
750
750
  <dl class="cli-reference">
751
+ <dt><code>--sync</code></dt>
752
+ <dd><p>Automatically synchronize only the Git sources used by the selected workflow. In Docker, Odoo is synced only with <code>[docker].odoo_source = workspace</code>; in Venv, Git-managed Odoo is synced. Both workflows sync configured Git addons.</p></dd>
753
+
751
754
  <dt><code>--sync-odoo</code></dt>
752
755
  <dd><p>Sync Git-managed Odoo sources; reuse <code>[odoo].path</code> without Git sync when a local path is configured.</p></dd>
753
756
 
@@ -755,10 +758,10 @@ Git source syntax: `git+REPO_URL//PATH/TO/PROJECT.ini?ref=REF`.
755
758
  <dd><p>Sync Git-managed addons into <code>ROOT/odoo-addons/</code>.</p></dd>
756
759
 
757
760
  <dt><code>--sync-all</code></dt>
758
- <dd><p>Sync both Odoo and addons.</p></dd>
761
+ <dd><p>Explicitly select both Odoo and addon sources, regardless of the selected workflow. Unlike <code>--sync</code>, this can fetch Odoo sources even when Docker runs Odoo from the base image.</p></dd>
759
762
 
760
763
  > **Note:**
761
- > Repository sync aborts if a target Git repository has uncommitted changes. Commit, stash or discard changes before syncing.
764
+ > Repository sync aborts if a target Git repository has uncommitted changes **or a local branch contains commits absent from the remote branch**. Commit/stash uncommitted changes or push/reconcile unpublished commits before syncing. The four sync switches are mutually exclusive; without any of them, <code>setup</code> only regenerates artifacts and does not fetch repositories.
762
765
 
763
766
  </dl>
764
767
 
@@ -801,7 +804,7 @@ odoo-compose setup ./odoo19
801
804
  odoo-compose setup ./odoo18 --set odoo:version=18.0
802
805
 
803
806
  # Native workflow:
804
- odoo-compose-venv setup ./odoo19 --sync-all --create-venv
807
+ odoo-compose-venv setup ./odoo19 --sync --create-venv
805
808
  odoo-compose-venv setup ./odoo18 --set odoo:version=18.0 --sync-all --create-venv
806
809
  ```
807
810
 
@@ -0,0 +1 @@
1
+ __version__ = "1.25.4"
@@ -2342,6 +2342,61 @@ def ensure_repo(
2342
2342
  _run(cmd)
2343
2343
 
2344
2344
 
2345
+ def _assert_branch_can_fast_forward(repo_dir: Path, branch: str) -> None:
2346
+ """Do not replace a local branch containing commits absent from origin.
2347
+
2348
+ A clean working tree does not imply that all local commits were pushed.
2349
+ Resetting the branch with ``checkout -B`` would otherwise discard its tip.
2350
+ Check the named branch (not HEAD, which might be another branch).
2351
+ """
2352
+ local_ref = f"refs/heads/{branch}"
2353
+ remote_ref = f"refs/remotes/origin/{branch}"
2354
+ present = subprocess.run(
2355
+ ["git", "show-ref", "--verify", "--quiet", local_ref],
2356
+ cwd=str(repo_dir), capture_output=True, text=True,
2357
+ )
2358
+ if present.returncode == 1:
2359
+ return # No existing local branch to overwrite.
2360
+ if present.returncode != 0:
2361
+ raise Exception(f"Failed to inspect local Git branch {branch!r} in {repo_dir}: {present.stderr}")
2362
+
2363
+ def is_fast_forward() -> bool:
2364
+ check = subprocess.run(
2365
+ ["git", "merge-base", "--is-ancestor", local_ref, remote_ref],
2366
+ cwd=str(repo_dir), capture_output=True, text=True,
2367
+ )
2368
+ if check.returncode not in (0, 1):
2369
+ raise Exception(f"Failed to compare Git branches in {repo_dir}: {check.stderr}")
2370
+ return check.returncode == 0
2371
+
2372
+ if is_fast_forward():
2373
+ return
2374
+
2375
+ # With a shallow checkout, the remote tip may have advanced beyond our
2376
+ # shallow boundary. Fetch just enough ancestry to distinguish a normal
2377
+ # fast-forward from unpublished local commits; fail closed if still unsure.
2378
+ if _is_shallow_repo(repo_dir):
2379
+ refspec = f"+refs/heads/{branch}:{remote_ref}"
2380
+ for deepen_by in (1, 8, 32, 128, 512):
2381
+ _run(["git", "fetch", "--deepen", str(deepen_by), "origin", refspec], cwd=repo_dir)
2382
+ if is_fast_forward():
2383
+ return
2384
+ if not _is_shallow_repo(repo_dir):
2385
+ break
2386
+ if _is_shallow_repo(repo_dir):
2387
+ _run(["git", "fetch", "--unshallow", "origin", refspec], cwd=repo_dir)
2388
+ if is_fast_forward():
2389
+ return
2390
+
2391
+ raise Exception(
2392
+ f"Refusing to reset local Git branch {branch!r} in {repo_dir}: "
2393
+ f"it contains commits that are not on origin/{branch} "
2394
+ "(or the remote branch history diverged).\n"
2395
+ "Your commits are preserved. Inspect `git log` and `git status`, "
2396
+ "then push, rebase or resolve the divergence manually before syncing."
2397
+ )
2398
+
2399
+
2345
2400
  def checkout_branch(
2346
2401
  dest: Path,
2347
2402
  branch: str,
@@ -2356,8 +2411,9 @@ def checkout_branch(
2356
2411
  This matches the previous behavior and is suitable for full clones (e.g. addons).
2357
2412
 
2358
2413
  - fetch_all=False: fetch ONLY `origin/<branch>` (optionally shallow via depth),
2359
- then force local branch `<branch>` to match `origin/<branch>`.
2414
+ then fast-forward the local branch to `origin/<branch>`.
2360
2415
  This is intended for the Odoo repo where we want single-branch + shallow clones.
2416
+ - Local commits absent from the remote are never silently discarded.
2361
2417
  - already_fetched=True: reuse the fetch performed by ensure_repo() instead
2362
2418
  of fetching the same branch again.
2363
2419
  """
@@ -2372,29 +2428,16 @@ def checkout_branch(
2372
2428
  _ensure_full_origin_refspec(dest)
2373
2429
  _unshallow_if_needed(dest)
2374
2430
  _run(["git", "fetch", "--all", "--tags", "--prune"], cwd=dest)
2431
+ else:
2432
+ # Narrow fetch: ensure origin/<branch> exists even if origin was cloned
2433
+ # with --single-branch and has a restricted remote.origin.fetch refspec.
2434
+ # ensure_repo() already fetched this ref when already_fetched=True.
2435
+ if not already_fetched:
2436
+ _fetch_branch(dest, branch=branch, depth=depth)
2375
2437
 
2376
- try:
2377
- _run(["git", "rev-parse", "--verify", f"origin/{branch}"], cwd=dest)
2378
- _run(["git", "checkout", "-B", branch, f"origin/{branch}"], cwd=dest)
2379
- assert_clean_worktree(dest)
2380
- _run(["git", "pull", "--ff-only"], cwd=dest)
2381
- return
2382
- except:
2383
- pass
2384
-
2385
- _run(["git", "checkout", branch], cwd=dest)
2386
- return
2387
-
2388
- # Narrow fetch: ensure origin/<branch> exists even if origin was cloned
2389
- # with --single-branch and has a restricted remote.origin.fetch refspec.
2390
- # ensure_repo() already fetched this ref when already_fetched=True.
2391
- if not already_fetched:
2392
- _fetch_branch(dest, branch=branch, depth=depth)
2393
-
2394
- _run(["git", "rev-parse", "--verify", f"origin/{branch}"], cwd=dest)
2438
+ _run(["git", "rev-parse", "--verify", f"refs/remotes/origin/{branch}"], cwd=dest)
2439
+ _assert_branch_can_fast_forward(dest, branch)
2395
2440
  _run(["git", "checkout", "-B", branch, f"origin/{branch}"], cwd=dest)
2396
- # Ensure the working tree exactly matches the remote branch (no pull, no extra refs).
2397
- _run(["git", "reset", "--hard", f"origin/{branch}"], cwd=dest)
2398
2441
  assert_clean_worktree(dest)
2399
2442
 
2400
2443
 
@@ -5493,8 +5536,8 @@ def build_parser(prog: str = "odoo-compose", target: str = "docker", *, setup_co
5493
5536
  epilog = """Create or update an Odoo Docker workspace.
5494
5537
 
5495
5538
  Examples:
5496
- odoo-compose setup ./odoo19 --sync-addons
5497
- odoo-compose setup --sync-all --create-docker-deploy
5539
+ odoo-compose setup ./odoo19 --sync
5540
+ odoo-compose setup --sync --create-docker-deploy
5498
5541
  odoo-compose setup ./odoo-project.ini --show-last-run
5499
5542
  """
5500
5543
  else:
@@ -5502,8 +5545,8 @@ Examples:
5502
5545
  The virtual environment is recreated only when explicitly requested.
5503
5546
 
5504
5547
  Examples:
5505
- odoo-compose-venv setup ./odoo19 --sync-all --create-venv
5506
- odoo-compose-venv setup -i base.ini -i addons.ini --sync-all --create-venv
5548
+ odoo-compose-venv setup ./odoo19 --sync --create-venv
5549
+ odoo-compose-venv setup -i base.ini -i addons.ini --sync --create-venv
5507
5550
  odoo-compose-venv setup --create-from-bundle ./workspace.odt.zip --root ./restored
5508
5551
  """
5509
5552
 
@@ -5561,6 +5604,11 @@ Examples:
5561
5604
  )
5562
5605
 
5563
5606
  sync_group = parser.add_mutually_exclusive_group()
5607
+ sync_group.add_argument(
5608
+ "--sync", action="store_true",
5609
+ help=("Sync Git sources used by this workflow: Odoo for native venv or Docker "
5610
+ "odoo_source=workspace, plus configured Git addons"),
5611
+ )
5564
5612
  sync_group.add_argument("--sync-odoo", dest="odoo", action="store_true", help="Sync only Odoo repository")
5565
5613
  sync_group.add_argument("--sync-addons", dest="addons", action="store_true", help="Sync only addon repositories")
5566
5614
  sync_group.add_argument("--sync-all", dest="all", action="store_true", help="Sync Odoo + addons")
@@ -7077,8 +7125,8 @@ def main(target: str = "docker", prog: str = "odoo-compose") -> None:
7077
7125
  conflicting_options.append("INI")
7078
7126
  if getattr(args, 'include_inis', None):
7079
7127
  conflicting_options.append("--include")
7080
- if args.all or args.odoo or args.addons:
7081
- conflicting_options.append("--sync-*")
7128
+ if args.sync or args.all or args.odoo or args.addons:
7129
+ conflicting_options.append("--sync*")
7082
7130
  if bool(getattr(args, 'create_venv', False)) or create_venv_from_wheelhouse:
7083
7131
  conflicting_options.append("--create-venv*")
7084
7132
  if clear_pip_wheel_cache:
@@ -7348,7 +7396,27 @@ def main(target: str = "docker", prog: str = "odoo-compose") -> None:
7348
7396
  f"explicit local INI source was used; no existing ROOT/{_DEFAULT_PROJECT_INI_NAME}"
7349
7397
  )
7350
7398
 
7351
- if args.all:
7399
+ if args.sync:
7400
+ # Select only the Git sources required by the effective workspace.
7401
+ # Use the merged/resolved INI so --include, --set and -e affect selection.
7402
+ try:
7403
+ sync_cfg = load_project_config(
7404
+ ini_path, vars_overrides=vars_overrides, ini_overrides=ini_overrides,
7405
+ log_resolved=False, log_overrides=False,
7406
+ )
7407
+ except Exception as e:
7408
+ _logger.error('%s', e)
7409
+ raise SystemExit(1)
7410
+ sync_odoo = (
7411
+ not sync_cfg.odoo.is_local
7412
+ and (target == "venv" or _docker_uses_workspace_odoo(sync_cfg))
7413
+ )
7414
+ sync_addons = any(not addon.is_local for addon in sync_cfg.addons.values())
7415
+ _logger.info(
7416
+ "Auto sync (--sync): Odoo Git=%s, addon Git=%s",
7417
+ sync_odoo, sync_addons,
7418
+ )
7419
+ elif args.all:
7352
7420
  sync_odoo, sync_addons = True, True
7353
7421
  elif args.odoo:
7354
7422
  sync_odoo, sync_addons = True, False
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: odoo-devops-tools
3
- Version: 1.25.2
3
+ Version: 1.25.4
4
4
  Summary: Build reproducible Odoo workspaces from a single project definition.
5
5
  Author: Roman Lacko
6
6
  License-Expression: MIT
@@ -145,8 +145,8 @@ Add-Content -Path $PROFILE -Value 'odoo-compose-venv completion powershell | Out
145
145
  ```
146
146
 
147
147
  Restart your shell or reload its configuration to activate completion. For example,
148
- `odoo-compose setup --sy<TAB>` suggests matching options such as `--sync-odoo`,
149
- `--sync-addons`, and `--sync-all`.
148
+ `odoo-compose setup --sy<TAB>` suggests matching options such as `--sync`,
149
+ `--sync-odoo`, `--sync-addons`, and `--sync-all`.
150
150
 
151
151
  ---
152
152
 
@@ -216,7 +216,7 @@ branch = ${odoo:version}
216
216
  Sync the addon repositories and regenerate the Docker environment:
217
217
 
218
218
  ```bash
219
- odoo-compose setup --sync-addons
219
+ odoo-compose setup --sync
220
220
  odoo-compose up --build
221
221
  ```
222
222
 
@@ -255,7 +255,7 @@ odoo_source = workspace
255
255
  Sync the Odoo source and generate the Docker artifacts:
256
256
 
257
257
  ```bash
258
- odoo-compose setup --sync-all
258
+ odoo-compose setup --sync
259
259
  odoo-compose up --build
260
260
  ```
261
261
 
@@ -329,13 +329,13 @@ Use `--create-docker-deploy` to generate a self-contained Docker build context f
329
329
  Addon modules are staged into the build context so the resulting image does not depend on bind-mounted workspace sources:
330
330
 
331
331
  ```bash
332
- odoo-compose setup --sync-addons --create-docker-deploy
332
+ odoo-compose setup --sync --create-docker-deploy
333
333
  ```
334
334
 
335
335
  When `[docker].odoo_source = workspace`, sync the Odoo source as well:
336
336
 
337
337
  ```bash
338
- odoo-compose setup --sync-all --create-docker-deploy
338
+ odoo-compose setup --sync --create-docker-deploy
339
339
  ```
340
340
 
341
341
  This additionally creates:
@@ -364,7 +364,7 @@ In this workflow, Odoo runs directly on the host using a generated Python virtua
364
364
  Create the workspace with the Odoo source and virtual environment:
365
365
 
366
366
  ```bash
367
- odoo-compose-venv setup ./odoo19 --sync-all --create-venv \
367
+ odoo-compose-venv setup ./odoo19 --sync --create-venv \
368
368
  --set config:db_host=127.0.0.1 \
369
369
  --set config:db_name=odoo \
370
370
  --set config:db_user=odoo \
@@ -423,7 +423,7 @@ branch = ${odoo:version}
423
423
  Sync the addon repositories and recreate the Python environment to include their dependencies:
424
424
 
425
425
  ```bash
426
- odoo-compose-venv setup --sync-all --create-venv
426
+ odoo-compose-venv setup --sync --create-venv
427
427
  ```
428
428
 
429
429
  The repositories are cloned into `ROOT/odoo-addons/` and automatically added to the generated `addons_path`. Python dependencies from their `requirements.txt` files are included in the virtual environment.
@@ -467,7 +467,7 @@ python_version = 3.11
467
467
  After changing the project file, run `odoo-compose` again from the workspace root:
468
468
 
469
469
  ```bash
470
- odoo-compose-venv setup --sync-all --create-venv
470
+ odoo-compose-venv setup --sync --create-venv
471
471
  ```
472
472
 
473
473
  This recreates the virtual environment at `ROOT/venv` using the system Python.
@@ -557,7 +557,7 @@ Those machine-specific outputs are recreated on the target machine.
557
557
  On an internet-connected build machine, sync the sources, build the wheelhouse, and create the bundle in one command:
558
558
 
559
559
  ```bash
560
- odoo-compose-venv setup --sync-all --create-venv --create-bundle
560
+ odoo-compose-venv setup --sync --create-venv --create-bundle
561
561
  ```
562
562
 
563
563
  When no output path is supplied, the bundle is written to:
@@ -569,7 +569,7 @@ ROOT/dist/ROOT-NAME.odt.zip
569
569
  You can also select an explicit output file:
570
570
 
571
571
  ```bash
572
- odoo-compose-venv setup --sync-all --create-venv --create-bundle ./artifacts/odoo18-production.odt.zip
572
+ odoo-compose-venv setup --sync --create-venv --create-bundle ./artifacts/odoo18-production.odt.zip
573
573
  ```
574
574
 
575
575
  #### 4.1.1. Including uncommitted changes
@@ -579,7 +579,7 @@ By default, bundle creation stops when a bundled Git repository has uncommitted
579
579
  To intentionally include those changes in the bundle, use:
580
580
 
581
581
  ```bash
582
- odoo-compose-venv setup --sync-all --create-venv --create-bundle --allow-dirty-bundle
582
+ odoo-compose-venv setup --sync --create-venv --create-bundle --allow-dirty-bundle
583
583
  ```
584
584
 
585
585
  ### 4.2. Create the workspace on the target machine
@@ -776,6 +776,9 @@ Git source syntax: `git+REPO_URL//PATH/TO/PROJECT.ini?ref=REF`.
776
776
  **Repository synchronization**
777
777
 
778
778
  <dl class="cli-reference">
779
+ <dt><code>--sync</code></dt>
780
+ <dd><p>Automatically synchronize only the Git sources used by the selected workflow. In Docker, Odoo is synced only with <code>[docker].odoo_source = workspace</code>; in Venv, Git-managed Odoo is synced. Both workflows sync configured Git addons.</p></dd>
781
+
779
782
  <dt><code>--sync-odoo</code></dt>
780
783
  <dd><p>Sync Git-managed Odoo sources; reuse <code>[odoo].path</code> without Git sync when a local path is configured.</p></dd>
781
784
 
@@ -783,10 +786,10 @@ Git source syntax: `git+REPO_URL//PATH/TO/PROJECT.ini?ref=REF`.
783
786
  <dd><p>Sync Git-managed addons into <code>ROOT/odoo-addons/</code>.</p></dd>
784
787
 
785
788
  <dt><code>--sync-all</code></dt>
786
- <dd><p>Sync both Odoo and addons.</p></dd>
789
+ <dd><p>Explicitly select both Odoo and addon sources, regardless of the selected workflow. Unlike <code>--sync</code>, this can fetch Odoo sources even when Docker runs Odoo from the base image.</p></dd>
787
790
 
788
791
  > **Note:**
789
- > Repository sync aborts if a target Git repository has uncommitted changes. Commit, stash or discard changes before syncing.
792
+ > Repository sync aborts if a target Git repository has uncommitted changes **or a local branch contains commits absent from the remote branch**. Commit/stash uncommitted changes or push/reconcile unpublished commits before syncing. The four sync switches are mutually exclusive; without any of them, <code>setup</code> only regenerates artifacts and does not fetch repositories.
790
793
 
791
794
  </dl>
792
795
 
@@ -829,7 +832,7 @@ odoo-compose setup ./odoo19
829
832
  odoo-compose setup ./odoo18 --set odoo:version=18.0
830
833
 
831
834
  # Native workflow:
832
- odoo-compose-venv setup ./odoo19 --sync-all --create-venv
835
+ odoo-compose-venv setup ./odoo19 --sync --create-venv
833
836
  odoo-compose-venv setup ./odoo18 --set odoo:version=18.0 --sync-all --create-venv
834
837
  ```
835
838
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "odoo-devops-tools"
7
- version = "1.25.2"
7
+ version = "1.25.4"
8
8
  description = "Build reproducible Odoo workspaces from a single project definition."
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -1 +0,0 @@
1
- __version__ = "1.25.2"