odoo-devops-tools 1.20.2__tar.gz → 1.20.3__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.
- {odoo_devops_tools-1.20.2 → odoo_devops_tools-1.20.3}/PKG-INFO +247 -192
- {odoo_devops_tools-1.20.2 → odoo_devops_tools-1.20.3}/README.md +246 -191
- odoo_devops_tools-1.20.3/odoo_devops_tools/__init__.py +1 -0
- {odoo_devops_tools-1.20.2 → odoo_devops_tools-1.20.3}/odoo_devops_tools.egg-info/PKG-INFO +247 -192
- {odoo_devops_tools-1.20.2 → odoo_devops_tools-1.20.3}/pyproject.toml +1 -1
- odoo_devops_tools-1.20.2/odoo_devops_tools/__init__.py +0 -1
- {odoo_devops_tools-1.20.2 → odoo_devops_tools-1.20.3}/LICENSE +0 -0
- {odoo_devops_tools-1.20.2 → odoo_devops_tools-1.20.3}/odoo_devops_tools/env.py +0 -0
- {odoo_devops_tools-1.20.2 → odoo_devops_tools-1.20.3}/odoo_devops_tools.egg-info/SOURCES.txt +0 -0
- {odoo_devops_tools-1.20.2 → odoo_devops_tools-1.20.3}/odoo_devops_tools.egg-info/dependency_links.txt +0 -0
- {odoo_devops_tools-1.20.2 → odoo_devops_tools-1.20.3}/odoo_devops_tools.egg-info/entry_points.txt +0 -0
- {odoo_devops_tools-1.20.2 → odoo_devops_tools-1.20.3}/odoo_devops_tools.egg-info/top_level.txt +0 -0
- {odoo_devops_tools-1.20.2 → odoo_devops_tools-1.20.3}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: odoo-devops-tools
|
|
3
|
-
Version: 1.20.
|
|
3
|
+
Version: 1.20.3
|
|
4
4
|
Summary: A small set of utilities for local Odoo development and simple Odoo deployments.
|
|
5
5
|
Author: Roman Lacko
|
|
6
6
|
License-Expression: MIT
|
|
@@ -52,7 +52,7 @@ From this configuration, `odt-env` can generate a workspace such as:
|
|
|
52
52
|
```text
|
|
53
53
|
ROOT/
|
|
54
54
|
├── docker/ # generated Docker artifacts
|
|
55
|
-
│ ├── local/ #
|
|
55
|
+
│ ├── local/ # Docker workflow artifacts
|
|
56
56
|
│ │ └── scripts/ # database and filestore backup/restore helpers
|
|
57
57
|
│ └── deploy/ # self-contained deploy build context
|
|
58
58
|
├── odoo/ # Odoo source
|
|
@@ -66,7 +66,7 @@ ROOT/
|
|
|
66
66
|
├── odoo-backups/ # backups created by helper scripts
|
|
67
67
|
├── wheelhouse/ # offline Python wheelhouse
|
|
68
68
|
├── venv/ # Python virtual environment
|
|
69
|
-
├── compose.yaml #
|
|
69
|
+
├── compose.yaml # Docker Compose file
|
|
70
70
|
└── odoo-project.ini # workspace configuration
|
|
71
71
|
```
|
|
72
72
|
|
|
@@ -110,12 +110,12 @@ odt-env --help
|
|
|
110
110
|
|
|
111
111
|
`odt-env` supports two development workflows:
|
|
112
112
|
|
|
113
|
-
- **
|
|
113
|
+
- **Docker workflow** — run Odoo and PostgreSQL with the generated Docker Compose environment.
|
|
114
114
|
- **Native development with venv** — run Odoo directly on the host using a generated Python virtual environment.
|
|
115
115
|
|
|
116
116
|
Choose the workflow that fits your environment. Both use the same `odoo-project.ini` project definition.
|
|
117
117
|
|
|
118
|
-
###
|
|
118
|
+
### Docker workflow
|
|
119
119
|
|
|
120
120
|
Create a new workspace:
|
|
121
121
|
|
|
@@ -171,9 +171,11 @@ Odoo starts with the generated configuration from `./odoo-configs/odoo-server.co
|
|
|
171
171
|
|
|
172
172
|
## Usage
|
|
173
173
|
|
|
174
|
-
The examples below use the
|
|
174
|
+
The examples below use the workspace configuration introduced in the Quick start section.
|
|
175
175
|
|
|
176
|
-
|
|
176
|
+
### 1. Docker workflow
|
|
177
|
+
|
|
178
|
+
The Docker workflow uses the following `odoo-project.ini` configuration:
|
|
177
179
|
|
|
178
180
|
```ini
|
|
179
181
|
[virtualenv]
|
|
@@ -196,17 +198,15 @@ base_image = odoo:19.0
|
|
|
196
198
|
[config]
|
|
197
199
|
```
|
|
198
200
|
|
|
199
|
-
The local Docker workflow can use this configuration as-is. The native quick start adds the PostgreSQL connection settings to `[config]` through `--set`.
|
|
200
|
-
|
|
201
201
|
Edit this file when you want to add extra addons, change configuration values, pin repositories, or adjust Python dependency handling.
|
|
202
202
|
|
|
203
|
-
|
|
203
|
+
#### 1.1. Adding extra addons
|
|
204
204
|
|
|
205
205
|
To extend Odoo with additional functionality, add extra addons through `[addons.<name>]` sections in `odoo-project.ini`.
|
|
206
206
|
|
|
207
207
|
In this example, we add two Git-based addon repositories, `OCA/web` and `OCA/helpdesk`.
|
|
208
208
|
|
|
209
|
-
|
|
209
|
+
##### 1.1.1. Update the project file
|
|
210
210
|
|
|
211
211
|
Edit `odoo-project.ini` in the workspace root and add these addon sections:
|
|
212
212
|
|
|
@@ -222,9 +222,10 @@ branch = ${odoo:version}
|
|
|
222
222
|
|
|
223
223
|
The rest of the generated project file can stay unchanged.
|
|
224
224
|
|
|
225
|
-
|
|
225
|
+
##### 1.1.2. Sync and install addons
|
|
226
|
+
|
|
226
227
|
|
|
227
|
-
Sync the configured addon repositories and refresh the generated
|
|
228
|
+
Sync the configured addon repositories and refresh the generated Docker workflow artifacts:
|
|
228
229
|
|
|
229
230
|
```bash
|
|
230
231
|
odt-env --sync-addons
|
|
@@ -233,7 +234,7 @@ docker compose up --build -d
|
|
|
233
234
|
|
|
234
235
|
The addon repositories are cloned into `ROOT/odoo-addons/oca-web/` and `ROOT/odoo-addons/oca-helpdesk/` and bind-mounted into the Odoo container.
|
|
235
236
|
|
|
236
|
-
If an addon source contains a `requirements.txt` file, its Python dependencies are included when the
|
|
237
|
+
If an addon source contains a `requirements.txt` file, its Python dependencies are included when the Docker image is rebuilt.
|
|
237
238
|
|
|
238
239
|
Install the modules from the newly added addon repositories:
|
|
239
240
|
|
|
@@ -250,33 +251,10 @@ For subsequent addon updates, run `click-odoo-update` inside the Odoo container:
|
|
|
250
251
|
docker compose exec odoo click-odoo-update -c /etc/odoo/odoo.conf -d odoo
|
|
251
252
|
```
|
|
252
253
|
|
|
253
|
-
#### 1.3. Native development with venv
|
|
254
|
-
|
|
255
|
-
Sync the sources and recreate the Python environment so dependencies from the new addon repositories are included:
|
|
256
|
-
|
|
257
|
-
```bash
|
|
258
|
-
odt-env --sync-all --create-venv
|
|
259
|
-
```
|
|
260
|
-
|
|
261
|
-
The addon repositories are cloned into `ROOT/odoo-addons/oca-web/` and `ROOT/odoo-addons/oca-helpdesk/`, and their directories are added to the generated `addons_path`.
|
|
262
|
-
|
|
263
|
-
Start Odoo and install the modules from the newly added addon repositories:
|
|
264
|
-
|
|
265
|
-
```bash
|
|
266
|
-
./odoo-scripts/run.sh -i web_notify,helpdesk_mgmt
|
|
267
|
-
```
|
|
268
|
-
|
|
269
|
-
For subsequent addon updates, use the generated update script:
|
|
270
|
-
|
|
271
|
-
```bash
|
|
272
|
-
./odoo-scripts/update.sh
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
The generated script uses `click-odoo-update` with the workspace Odoo configuration.
|
|
276
254
|
|
|
277
|
-
|
|
255
|
+
#### 1.2. Backup and restore
|
|
278
256
|
|
|
279
|
-
The
|
|
257
|
+
The Docker workflow generates Unix shell helpers under `ROOT/docker/local/scripts/` for backing up and restoring the PostgreSQL database and Odoo filestore independently:
|
|
280
258
|
|
|
281
259
|
```text
|
|
282
260
|
docker/local/scripts/
|
|
@@ -297,7 +275,7 @@ The default database name is taken from `[config].db_name` when configured, othe
|
|
|
297
275
|
ODOO_DB_NAME=odoo_test ./docker/local/scripts/backup-db.sh
|
|
298
276
|
```
|
|
299
277
|
|
|
300
|
-
|
|
278
|
+
##### 1.2.1. Database backup
|
|
301
279
|
|
|
302
280
|
Create a PostgreSQL custom-format dump under `ROOT/odoo-backups/`:
|
|
303
281
|
|
|
@@ -317,7 +295,7 @@ Pass an output path explicitly when needed:
|
|
|
317
295
|
./docker/local/scripts/backup-db.sh ./odoo-backups/pre-upgrade.dump
|
|
318
296
|
```
|
|
319
297
|
|
|
320
|
-
|
|
298
|
+
##### 1.2.2. Database restore
|
|
321
299
|
|
|
322
300
|
Restore a database dump with `pg_restore`:
|
|
323
301
|
|
|
@@ -339,7 +317,7 @@ To restore the same dump into another database without replacing the default dat
|
|
|
339
317
|
ODOO_DB_NAME=odoo_restore ./docker/local/scripts/restore-db.sh ./odoo-backups/pre-upgrade.dump
|
|
340
318
|
```
|
|
341
319
|
|
|
342
|
-
|
|
320
|
+
##### 1.2.3. Filestore backup
|
|
343
321
|
|
|
344
322
|
Create a compressed tar archive of the selected database filestore:
|
|
345
323
|
|
|
@@ -370,7 +348,7 @@ docker compose stop odoo
|
|
|
370
348
|
docker compose up -d odoo
|
|
371
349
|
```
|
|
372
350
|
|
|
373
|
-
|
|
351
|
+
##### 1.2.4. Filestore restore
|
|
374
352
|
|
|
375
353
|
Restore a filestore archive:
|
|
376
354
|
|
|
@@ -394,11 +372,11 @@ ODOO_DB_NAME=odoo_restore ./docker/local/scripts/restore-filestore.sh ./odoo-bac
|
|
|
394
372
|
|
|
395
373
|
Database and filestore backups are intentionally separate. This allows either part to be restored independently while still making it possible to create matching database and filestore backups when both are needed.
|
|
396
374
|
|
|
397
|
-
|
|
375
|
+
##### 1.2.5. Restic filestore backup
|
|
398
376
|
|
|
399
377
|
The generated Docker image also includes `restic`, installed from the base image APT repositories. Restic is an additional option intended especially for large filestores where incremental snapshots and deduplication are useful.
|
|
400
378
|
|
|
401
|
-
The
|
|
379
|
+
The Docker workflow generates three additional helpers:
|
|
402
380
|
|
|
403
381
|
```text
|
|
404
382
|
docker/local/scripts/restic.sh
|
|
@@ -442,7 +420,7 @@ List or inspect snapshots through the generic wrapper:
|
|
|
442
420
|
./docker/local/scripts/restic.sh check
|
|
443
421
|
```
|
|
444
422
|
|
|
445
|
-
|
|
423
|
+
##### 1.2.6. Restic filestore restore
|
|
446
424
|
|
|
447
425
|
Restore the latest matching filestore snapshot:
|
|
448
426
|
|
|
@@ -468,9 +446,8 @@ ODOO_DB_NAME=odoo_restore RESTIC_SOURCE_DB_NAME=odoo ./docker/local/scripts/rest
|
|
|
468
446
|
|
|
469
447
|
The restore helper removes the target database filestore before restoring it. When `latest` is used, the snapshot selection is restricted to the current `RESTIC_HOST` and source filestore path. Use the same `RESTIC_HOST` value that was used when the snapshot was created if the restore is performed from another host.
|
|
470
448
|
|
|
471
|
-
---
|
|
472
449
|
|
|
473
|
-
|
|
450
|
+
#### 1.3. Creating a Docker deploy build context
|
|
474
451
|
|
|
475
452
|
Use `--create-docker-deploy` to generate a self-contained Docker build context for CI/CD, testing, staging, production, or another non-local deployment workflow.
|
|
476
453
|
|
|
@@ -500,9 +477,9 @@ Addon modules are staged under `docker/deploy/addons/` and copied into `/mnt/ext
|
|
|
500
477
|
docker build -t mycompany/odoo:19.0 docker/deploy
|
|
501
478
|
```
|
|
502
479
|
|
|
503
|
-
`[docker].base_image` controls the base image used by both
|
|
480
|
+
`[docker].base_image` controls the base image used by both generated Dockerfiles.
|
|
504
481
|
|
|
505
|
-
In CI, where the local
|
|
482
|
+
In CI, where the `docker/local/` context is unnecessary, combine the options:
|
|
506
483
|
|
|
507
484
|
```bash
|
|
508
485
|
odt-env --sync-addons --create-docker-deploy --no-local-docker
|
|
@@ -511,57 +488,92 @@ docker build -t mycompany/odoo:19.0 docker/deploy
|
|
|
511
488
|
|
|
512
489
|
---
|
|
513
490
|
|
|
514
|
-
###
|
|
491
|
+
### 2. Native development with venv
|
|
515
492
|
|
|
516
|
-
The
|
|
493
|
+
The native workflow uses the following `odoo-project.ini` configuration, with PostgreSQL connection settings added to `[config]`:
|
|
517
494
|
|
|
518
|
-
|
|
495
|
+
```ini
|
|
496
|
+
[virtualenv]
|
|
497
|
+
managed_python = true
|
|
498
|
+
python_version =
|
|
499
|
+
build_constraints =
|
|
500
|
+
requirements =
|
|
501
|
+
requirements_ignore =
|
|
519
502
|
|
|
520
|
-
|
|
503
|
+
[odoo]
|
|
504
|
+
version = 19.0
|
|
505
|
+
repo = https://github.com/odoo/odoo.git
|
|
506
|
+
branch = 19.0
|
|
507
|
+
commit =
|
|
508
|
+
shallow = true
|
|
521
509
|
|
|
522
|
-
|
|
523
|
-
|
|
510
|
+
[docker]
|
|
511
|
+
base_image = odoo:19.0
|
|
524
512
|
|
|
525
|
-
|
|
513
|
+
[config]
|
|
514
|
+
db_host = 127.0.0.1
|
|
515
|
+
db_name = odoo
|
|
516
|
+
db_user = odoo
|
|
517
|
+
db_password = odoo
|
|
518
|
+
```
|
|
526
519
|
|
|
527
|
-
|
|
520
|
+
Edit this file when you want to add extra addons, change configuration values, pin repositories, or adjust Python dependency handling.
|
|
528
521
|
|
|
529
|
-
|
|
522
|
+
#### 2.1. Adding extra addons
|
|
523
|
+
|
|
524
|
+
To extend Odoo with additional functionality, add extra addons through `[addons.<name>]` sections in `odoo-project.ini`.
|
|
525
|
+
|
|
526
|
+
In this example, we add two Git-based addon repositories, `OCA/web` and `OCA/helpdesk`.
|
|
527
|
+
|
|
528
|
+
##### 2.1.1. Update the project file
|
|
529
|
+
|
|
530
|
+
Edit `odoo-project.ini` in the workspace root and add these addon sections:
|
|
530
531
|
|
|
531
532
|
```ini
|
|
532
|
-
[
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
533
|
+
[addons.oca-web]
|
|
534
|
+
repo = https://github.com/OCA/web.git
|
|
535
|
+
branch = ${odoo:version}
|
|
536
|
+
|
|
537
|
+
[addons.oca-helpdesk]
|
|
538
|
+
repo = https://github.com/OCA/helpdesk.git
|
|
539
|
+
branch = ${odoo:version}
|
|
536
540
|
```
|
|
537
541
|
|
|
538
|
-
|
|
542
|
+
The rest of the generated project file can stay unchanged.
|
|
539
543
|
|
|
540
|
-
|
|
544
|
+
##### 2.1.2. Sync and install addons
|
|
541
545
|
|
|
542
|
-
If you want to replace a package with a different distribution name, add the replacement to `requirements` and skip the original package with `requirements_ignore`.
|
|
543
546
|
|
|
544
|
-
|
|
547
|
+
Sync the sources and recreate the Python environment so dependencies from the new addon repositories are included:
|
|
545
548
|
|
|
546
|
-
```
|
|
547
|
-
|
|
548
|
-
requirements =
|
|
549
|
-
psycopg2-binary==2.9.9
|
|
550
|
-
requirements_ignore =
|
|
551
|
-
psycopg2
|
|
549
|
+
```bash
|
|
550
|
+
odt-env --sync-all --create-venv
|
|
552
551
|
```
|
|
553
552
|
|
|
554
|
-
|
|
553
|
+
The addon repositories are cloned into `ROOT/odoo-addons/oca-web/` and `ROOT/odoo-addons/oca-helpdesk/`, and their directories are added to the generated `addons_path`.
|
|
555
554
|
|
|
556
|
-
|
|
555
|
+
Start Odoo and install the modules from the newly added addon repositories:
|
|
557
556
|
|
|
558
|
-
|
|
557
|
+
```bash
|
|
558
|
+
./odoo-scripts/run.sh -i web_notify,helpdesk_mgmt
|
|
559
|
+
```
|
|
560
|
+
|
|
561
|
+
For subsequent addon updates, use the generated update script:
|
|
562
|
+
|
|
563
|
+
```bash
|
|
564
|
+
./odoo-scripts/update.sh
|
|
565
|
+
```
|
|
566
|
+
|
|
567
|
+
The generated script uses `click-odoo-update` with the workspace Odoo configuration.
|
|
568
|
+
|
|
569
|
+
|
|
570
|
+
#### 2.2. Using system Python instead of managed Python
|
|
559
571
|
|
|
560
572
|
By default, `odt-env` uses `uv` to install and manage the requested Python version.
|
|
561
573
|
|
|
562
574
|
If you already have a suitable system Python installed, you can disable managed Python.
|
|
563
575
|
|
|
564
|
-
|
|
576
|
+
##### 2.2.1. Update the project file
|
|
565
577
|
|
|
566
578
|
Disable managed Python by adding `python_version = 3.11` and `managed_python = false` to the `odoo-project.ini` file.
|
|
567
579
|
|
|
@@ -575,7 +587,7 @@ managed_python = false
|
|
|
575
587
|
python_version = 3.11
|
|
576
588
|
```
|
|
577
589
|
|
|
578
|
-
|
|
590
|
+
##### 2.2.2. Update the workspace
|
|
579
591
|
|
|
580
592
|
After changing the project file, run `odt-env` again from the workspace root:
|
|
581
593
|
|
|
@@ -585,9 +597,156 @@ odt-env --sync-all --create-venv
|
|
|
585
597
|
|
|
586
598
|
This recreates the virtual environment at `ROOT/venv` using the system Python.
|
|
587
599
|
|
|
600
|
+
#### 2.3. Script reference
|
|
601
|
+
|
|
602
|
+
This section describes the native helpers under `ROOT/odoo-scripts/`. Docker backup/restore helpers are documented in the Docker workflow section above.
|
|
603
|
+
|
|
604
|
+
Most helper scripts are generated in both Unix (`.sh`) and Windows (`.bat`) variants. `instance.sh` is available only on Unix-like systems.
|
|
605
|
+
|
|
606
|
+
Native database backup and restore scripts are generated only when `[config].db_name` is configured.
|
|
607
|
+
|
|
608
|
+
The examples below use the Unix form.
|
|
609
|
+
|
|
610
|
+
##### 2.3.1. run
|
|
611
|
+
|
|
612
|
+
Starts Odoo in the foreground.
|
|
613
|
+
|
|
614
|
+
Any extra arguments are forwarded to the underlying command `odoo-bin`.
|
|
615
|
+
|
|
616
|
+
Examples:
|
|
617
|
+
|
|
618
|
+
```bash
|
|
619
|
+
./odoo-scripts/run.sh
|
|
620
|
+
./odoo-scripts/run.sh --dev=all
|
|
621
|
+
./odoo-scripts/run.sh -i sale,crm --without-demo=all
|
|
622
|
+
```
|
|
623
|
+
|
|
624
|
+
##### 2.3.2. instance
|
|
625
|
+
|
|
626
|
+
Manages Odoo as a background service on Unix-like systems.
|
|
627
|
+
|
|
628
|
+
Logs are written to `ROOT/odoo-logs/odoo-server.log` and the PID is stored in `ROOT/odoo-logs/odoo-server.pid`.
|
|
629
|
+
|
|
630
|
+
Examples:
|
|
631
|
+
|
|
632
|
+
```bash
|
|
633
|
+
./odoo-scripts/instance.sh start
|
|
634
|
+
./odoo-scripts/instance.sh stop
|
|
635
|
+
./odoo-scripts/instance.sh restart
|
|
636
|
+
./odoo-scripts/instance.sh status
|
|
637
|
+
```
|
|
638
|
+
|
|
639
|
+
##### 2.3.3. test
|
|
640
|
+
|
|
641
|
+
Runs Odoo tests.
|
|
642
|
+
|
|
643
|
+
The script always adds `--test-enable --stop-after-init`.
|
|
644
|
+
|
|
645
|
+
Any extra arguments are forwarded to the underlying command `odoo-bin`.
|
|
646
|
+
|
|
647
|
+
Examples:
|
|
648
|
+
|
|
649
|
+
```bash
|
|
650
|
+
./odoo-scripts/test.sh
|
|
651
|
+
./odoo-scripts/test.sh -i sale --test-tags /sale
|
|
652
|
+
```
|
|
653
|
+
|
|
654
|
+
##### 2.3.4. shell
|
|
655
|
+
|
|
656
|
+
Opens an Odoo shell.
|
|
657
|
+
|
|
658
|
+
Examples:
|
|
659
|
+
|
|
660
|
+
```bash
|
|
661
|
+
./odoo-scripts/shell.sh
|
|
662
|
+
```
|
|
663
|
+
|
|
664
|
+
##### 2.3.5. backup
|
|
665
|
+
|
|
666
|
+
Creates a timestamped ZIP backup under `ROOT/odoo-backups/`.
|
|
667
|
+
|
|
668
|
+
Any extra arguments are forwarded to the underlying command `click-odoo-backupdb` from [`click-odoo-contrib`](https://pypi.org/project/click-odoo-contrib/#click-odoo-backupdb-beta) package.
|
|
669
|
+
|
|
670
|
+
Examples:
|
|
671
|
+
|
|
672
|
+
```bash
|
|
673
|
+
./odoo-scripts/backup.sh
|
|
674
|
+
```
|
|
675
|
+
|
|
676
|
+
##### 2.3.6. restore
|
|
677
|
+
|
|
678
|
+
Restores a backup into the configured database.
|
|
679
|
+
|
|
680
|
+
The script always adds `--copy --neutralize`.
|
|
681
|
+
|
|
682
|
+
Any extra arguments are forwarded to the underlying command `click-odoo-restoredb` from [`click-odoo-contrib`](https://pypi.org/project/click-odoo-contrib/#click-odoo-restoredb-beta) package.
|
|
683
|
+
|
|
684
|
+
Examples:
|
|
685
|
+
|
|
686
|
+
```bash
|
|
687
|
+
./odoo-scripts/restore.sh ./odoo-backups/odoo_20260331_221443.zip
|
|
688
|
+
./odoo-scripts/restore.sh ./odoo-backups/odoo_20260331_221443.zip --force
|
|
689
|
+
```
|
|
690
|
+
|
|
691
|
+
##### 2.3.7. update
|
|
692
|
+
|
|
693
|
+
Updates an Odoo database automatically detecting addons to update based on a hash of their file content.
|
|
694
|
+
|
|
695
|
+
Any extra arguments are forwarded to the underlying command `click-odoo-update` from [`click-odoo-contrib`](https://pypi.org/project/click-odoo-contrib/#click-odoo-update-stable) package.
|
|
696
|
+
|
|
697
|
+
Examples:
|
|
698
|
+
|
|
699
|
+
```bash
|
|
700
|
+
./odoo-scripts/update.sh
|
|
701
|
+
./odoo-scripts/update.sh --update-all
|
|
702
|
+
```
|
|
703
|
+
|
|
704
|
+
|
|
705
|
+
### 3. Managing Python requirements
|
|
706
|
+
|
|
707
|
+
The `[virtualenv]` section controls additional Python dependencies used when provisioning both the native virtual environment and generated Docker images.
|
|
708
|
+
|
|
709
|
+
Use it to add new packages, pin specific versions, and override packages collected from Odoo or addon repository `requirements.txt` files.
|
|
710
|
+
|
|
711
|
+
Use:
|
|
712
|
+
|
|
713
|
+
- `requirements` to add extra packages or pin an explicit version
|
|
714
|
+
- `requirements_ignore` to skip packages that would otherwise be collected from repository requirements files
|
|
715
|
+
|
|
716
|
+
When a package is listed in `requirements`, `odt-env` automatically gives that package priority by ignoring the same package name from collected repository requirements. This means you can usually pin a package version just by adding it to `requirements`.
|
|
717
|
+
|
|
718
|
+
#### 3.1. Add or pin packages
|
|
719
|
+
|
|
720
|
+
Use `requirements` to install additional packages or to force a specific version:
|
|
721
|
+
|
|
722
|
+
```ini
|
|
723
|
+
[virtualenv]
|
|
724
|
+
requirements =
|
|
725
|
+
requests==2.32.3
|
|
726
|
+
boto3==1.35.99
|
|
727
|
+
```
|
|
728
|
+
|
|
729
|
+
In this example, both packages are included in the generated dependency set and pinned to the specified versions.
|
|
730
|
+
|
|
731
|
+
#### 3.2. Override a package with a different one
|
|
732
|
+
|
|
733
|
+
If you want to replace a package with a different distribution name, add the replacement to `requirements` and skip the original package with `requirements_ignore`.
|
|
734
|
+
|
|
735
|
+
Example:
|
|
736
|
+
|
|
737
|
+
```ini
|
|
738
|
+
[virtualenv]
|
|
739
|
+
requirements =
|
|
740
|
+
psycopg2-binary==2.9.9
|
|
741
|
+
requirements_ignore =
|
|
742
|
+
psycopg2
|
|
743
|
+
```
|
|
744
|
+
|
|
745
|
+
In this example, `odt-env` installs `psycopg2-binary==2.9.9` and skips `psycopg2` when collecting repository requirements.
|
|
746
|
+
|
|
588
747
|
---
|
|
589
748
|
|
|
590
|
-
###
|
|
749
|
+
### 4. Creating portable workspace bundles
|
|
591
750
|
|
|
592
751
|
Portable bundles are useful when you want to prepare an Odoo workspace on an internet-connected machine and reproduce it on another compatible machine without cloning repositories or downloading Python packages again.
|
|
593
752
|
|
|
@@ -605,7 +764,7 @@ The bundle does not contain the virtual environment, database data, logs, backup
|
|
|
605
764
|
|
|
606
765
|
Those machine-specific outputs are recreated on the target machine.
|
|
607
766
|
|
|
608
|
-
####
|
|
767
|
+
#### 4.1. Create a bundle on the build machine
|
|
609
768
|
|
|
610
769
|
On an internet-connected build machine, sync the sources, build the wheelhouse, and create the bundle in one command:
|
|
611
770
|
|
|
@@ -625,7 +784,7 @@ You can also select an explicit output file:
|
|
|
625
784
|
odt-env --sync-all --create-venv --create-bundle ./artifacts/odoo18-production.odt.zip
|
|
626
785
|
```
|
|
627
786
|
|
|
628
|
-
|
|
787
|
+
##### 4.1.1. Including uncommitted changes
|
|
629
788
|
|
|
630
789
|
By default, bundle creation stops when a bundled Git repository has uncommitted changes.
|
|
631
790
|
|
|
@@ -635,7 +794,7 @@ To intentionally include those changes in the bundle, use:
|
|
|
635
794
|
odt-env --sync-all --create-venv --create-bundle --allow-dirty-bundle
|
|
636
795
|
```
|
|
637
796
|
|
|
638
|
-
####
|
|
797
|
+
#### 4.2. Create the workspace on the target machine
|
|
639
798
|
|
|
640
799
|
Copy the ZIP to the target machine and import it into an empty directory:
|
|
641
800
|
|
|
@@ -662,7 +821,7 @@ The import operation:
|
|
|
662
821
|
> **Compatibility note**
|
|
663
822
|
> A wheelhouse is platform- and architecture-dependent. Create and import a bundle on compatible systems, for example Linux x86-64 to Linux x86-64. The target machine must have `uv` and access to the configured Python version. When `[virtualenv].managed_python = true`, `uv` may still need network access if that Python interpreter is not already installed or cached. For a fully disconnected target, install the required Python interpreter beforehand or use `managed_python = false`.
|
|
664
823
|
|
|
665
|
-
####
|
|
824
|
+
#### 4.3. Manual wheelhouse workflow
|
|
666
825
|
|
|
667
826
|
The existing manual workflow remains available. After preparing a complete workspace on the build machine, copy the whole workspace and run this command from the copied root:
|
|
668
827
|
|
|
@@ -685,9 +844,9 @@ odt-env [INI] [OPTIONS]
|
|
|
685
844
|
If no arguments are specified, `odt-env` treats the current working directory as ROOT and, when `ROOT/odoo-project.ini` exists,
|
|
686
845
|
regenerates the workspace artifacts without syncing repositories or recreating the virtual environment.
|
|
687
846
|
|
|
688
|
-
###
|
|
847
|
+
### Project definition (`INI`)
|
|
689
848
|
|
|
690
|
-
|
|
849
|
+
`INI` is the optional project definition source used by `odt-env`. It can be:
|
|
691
850
|
|
|
692
851
|
- a local filesystem path, for example:
|
|
693
852
|
|
|
@@ -788,11 +947,11 @@ Maintenance:
|
|
|
788
947
|
|
|
789
948
|
- `--create-bundle [BUNDLE]` — create a verified portable ZIP containing Odoo sources, configured addon sources, a sanitized `odoo-project.ini`, and `ROOT/wheelhouse/`. If `BUNDLE` is omitted, the output is `ROOT/dist/ROOT-NAME.odt.zip`. Relative explicit output paths are resolved from the current working directory.
|
|
790
949
|
- `--allow-dirty-bundle` — allow `--create-bundle` to snapshot Git repositories with uncommitted changes. Without this option, dirty repositories abort bundle creation.
|
|
791
|
-
- `--create-from-bundle BUNDLE` — verify and extract a portable bundle into an empty `ROOT`, then recreate `ROOT/venv` using the bundled wheelhouse. This offline deployment path intentionally skips
|
|
950
|
+
- `--create-from-bundle BUNDLE` — verify and extract a portable bundle into an empty `ROOT`, then recreate `ROOT/venv` using the bundled wheelhouse. This offline deployment path intentionally skips Docker workflow generation; `--create-docker-deploy` cannot be combined with it.
|
|
792
951
|
|
|
793
952
|
### Docker generation
|
|
794
953
|
|
|
795
|
-
-
|
|
954
|
+
- Docker workflow generation is enabled by default. It regenerates `ROOT/docker/local/` and `ROOT/compose.yaml`; addon sources are bind-mounted from the workspace into the Odoo container. Database and filestore backup/restore helpers, including optional restic filestore helpers, are generated under `ROOT/docker/local/scripts/`.
|
|
796
955
|
- `--no-local-docker` — skip regeneration of `ROOT/docker/local/` and `ROOT/compose.yaml`. Existing files are not deleted.
|
|
797
956
|
- `--create-docker-deploy` — generate a self-contained deployment build context under `ROOT/docker/deploy/`. Addon modules are staged into the context.
|
|
798
957
|
|
|
@@ -816,7 +975,7 @@ The following sections are supported:
|
|
|
816
975
|
- `[virtualenv]` — optional Python and dependency settings
|
|
817
976
|
- `[odoo]` — required Odoo source settings
|
|
818
977
|
- `[addons.<name>]` — optional addon sources
|
|
819
|
-
- `[docker]` — optional
|
|
978
|
+
- `[docker]` — optional Docker workflow/deploy generation settings
|
|
820
979
|
- `[config]` — optional Odoo server configuration values
|
|
821
980
|
|
|
822
981
|
### General rules
|
|
@@ -983,107 +1142,3 @@ http_port = 8069
|
|
|
983
1142
|
```
|
|
984
1143
|
|
|
985
1144
|
---
|
|
986
|
-
|
|
987
|
-
## Script reference
|
|
988
|
-
|
|
989
|
-
This section describes the native helpers under `ROOT/odoo-scripts/`. Local Docker backup/restore helpers are documented in the Local Docker section above.
|
|
990
|
-
|
|
991
|
-
Most helper scripts are generated in both Unix (`.sh`) and Windows (`.bat`) variants. `instance.sh` is available only on Unix-like systems.
|
|
992
|
-
|
|
993
|
-
Native database backup and restore scripts are generated only when `[config].db_name` is configured.
|
|
994
|
-
|
|
995
|
-
The examples below use the Unix form.
|
|
996
|
-
|
|
997
|
-
### run
|
|
998
|
-
|
|
999
|
-
Starts Odoo in the foreground.
|
|
1000
|
-
|
|
1001
|
-
Any extra arguments are forwarded to the underlying command `odoo-bin`.
|
|
1002
|
-
|
|
1003
|
-
Examples:
|
|
1004
|
-
|
|
1005
|
-
```bash
|
|
1006
|
-
./odoo-scripts/run.sh
|
|
1007
|
-
./odoo-scripts/run.sh --dev=all
|
|
1008
|
-
./odoo-scripts/run.sh -i sale,crm --without-demo=all
|
|
1009
|
-
```
|
|
1010
|
-
|
|
1011
|
-
### instance
|
|
1012
|
-
|
|
1013
|
-
Manages Odoo as a background service on Unix-like systems.
|
|
1014
|
-
|
|
1015
|
-
Logs are written to `ROOT/odoo-logs/odoo-server.log` and the PID is stored in `ROOT/odoo-logs/odoo-server.pid`.
|
|
1016
|
-
|
|
1017
|
-
Examples:
|
|
1018
|
-
|
|
1019
|
-
```bash
|
|
1020
|
-
./odoo-scripts/instance.sh start
|
|
1021
|
-
./odoo-scripts/instance.sh stop
|
|
1022
|
-
./odoo-scripts/instance.sh restart
|
|
1023
|
-
./odoo-scripts/instance.sh status
|
|
1024
|
-
```
|
|
1025
|
-
|
|
1026
|
-
### test
|
|
1027
|
-
|
|
1028
|
-
Runs Odoo tests.
|
|
1029
|
-
|
|
1030
|
-
The script always adds `--test-enable --stop-after-init`.
|
|
1031
|
-
|
|
1032
|
-
Any extra arguments are forwarded to the underlying command `odoo-bin`.
|
|
1033
|
-
|
|
1034
|
-
Examples:
|
|
1035
|
-
|
|
1036
|
-
```bash
|
|
1037
|
-
./odoo-scripts/test.sh
|
|
1038
|
-
./odoo-scripts/test.sh -i sale --test-tags /sale
|
|
1039
|
-
```
|
|
1040
|
-
|
|
1041
|
-
### shell
|
|
1042
|
-
|
|
1043
|
-
Opens an Odoo shell.
|
|
1044
|
-
|
|
1045
|
-
Examples:
|
|
1046
|
-
|
|
1047
|
-
```bash
|
|
1048
|
-
./odoo-scripts/shell.sh
|
|
1049
|
-
```
|
|
1050
|
-
|
|
1051
|
-
### backup
|
|
1052
|
-
|
|
1053
|
-
Creates a timestamped ZIP backup under `ROOT/odoo-backups/`.
|
|
1054
|
-
|
|
1055
|
-
Any extra arguments are forwarded to the underlying command `click-odoo-backupdb` from [`click-odoo-contrib`](https://pypi.org/project/click-odoo-contrib/#click-odoo-backupdb-beta) package.
|
|
1056
|
-
|
|
1057
|
-
Examples:
|
|
1058
|
-
|
|
1059
|
-
```bash
|
|
1060
|
-
./odoo-scripts/backup.sh
|
|
1061
|
-
```
|
|
1062
|
-
|
|
1063
|
-
### restore
|
|
1064
|
-
|
|
1065
|
-
Restores a backup into the configured database.
|
|
1066
|
-
|
|
1067
|
-
The script always adds `--copy --neutralize`.
|
|
1068
|
-
|
|
1069
|
-
Any extra arguments are forwarded to the underlying command `click-odoo-restoredb` from [`click-odoo-contrib`](https://pypi.org/project/click-odoo-contrib/#click-odoo-restoredb-beta) package.
|
|
1070
|
-
|
|
1071
|
-
Examples:
|
|
1072
|
-
|
|
1073
|
-
```bash
|
|
1074
|
-
./odoo-scripts/restore.sh ./odoo-backups/odoo_20260331_221443.zip
|
|
1075
|
-
./odoo-scripts/restore.sh ./odoo-backups/odoo_20260331_221443.zip --force
|
|
1076
|
-
```
|
|
1077
|
-
|
|
1078
|
-
### update
|
|
1079
|
-
|
|
1080
|
-
Updates an Odoo database automatically detecting addons to update based on a hash of their file content.
|
|
1081
|
-
|
|
1082
|
-
Any extra arguments are forwarded to the underlying command `click-odoo-update` from [`click-odoo-contrib`](https://pypi.org/project/click-odoo-contrib/#click-odoo-update-stable) package.
|
|
1083
|
-
|
|
1084
|
-
Examples:
|
|
1085
|
-
|
|
1086
|
-
```bash
|
|
1087
|
-
./odoo-scripts/update.sh
|
|
1088
|
-
./odoo-scripts/update.sh --update-all
|
|
1089
|
-
```
|