odoo-devops-tools 1.20.3__tar.gz → 1.20.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.
- {odoo_devops_tools-1.20.3 → odoo_devops_tools-1.20.4}/PKG-INFO +62 -76
- {odoo_devops_tools-1.20.3 → odoo_devops_tools-1.20.4}/README.md +61 -75
- odoo_devops_tools-1.20.4/odoo_devops_tools/__init__.py +1 -0
- {odoo_devops_tools-1.20.3 → odoo_devops_tools-1.20.4}/odoo_devops_tools.egg-info/PKG-INFO +62 -76
- {odoo_devops_tools-1.20.3 → odoo_devops_tools-1.20.4}/pyproject.toml +1 -1
- odoo_devops_tools-1.20.3/odoo_devops_tools/__init__.py +0 -1
- {odoo_devops_tools-1.20.3 → odoo_devops_tools-1.20.4}/LICENSE +0 -0
- {odoo_devops_tools-1.20.3 → odoo_devops_tools-1.20.4}/odoo_devops_tools/env.py +0 -0
- {odoo_devops_tools-1.20.3 → odoo_devops_tools-1.20.4}/odoo_devops_tools.egg-info/SOURCES.txt +0 -0
- {odoo_devops_tools-1.20.3 → odoo_devops_tools-1.20.4}/odoo_devops_tools.egg-info/dependency_links.txt +0 -0
- {odoo_devops_tools-1.20.3 → odoo_devops_tools-1.20.4}/odoo_devops_tools.egg-info/entry_points.txt +0 -0
- {odoo_devops_tools-1.20.3 → odoo_devops_tools-1.20.4}/odoo_devops_tools.egg-info/top_level.txt +0 -0
- {odoo_devops_tools-1.20.3 → odoo_devops_tools-1.20.4}/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.4
|
|
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
|
|
@@ -106,7 +106,7 @@ odt-env --help
|
|
|
106
106
|
|
|
107
107
|
---
|
|
108
108
|
|
|
109
|
-
##
|
|
109
|
+
## Usage
|
|
110
110
|
|
|
111
111
|
`odt-env` supports two development workflows:
|
|
112
112
|
|
|
@@ -115,7 +115,7 @@ odt-env --help
|
|
|
115
115
|
|
|
116
116
|
Choose the workflow that fits your environment. Both use the same `odoo-project.ini` project definition.
|
|
117
117
|
|
|
118
|
-
|
|
118
|
+
## 1. Docker workflow
|
|
119
119
|
|
|
120
120
|
Create a new workspace:
|
|
121
121
|
|
|
@@ -141,40 +141,6 @@ docker compose run --rm odoo -- -c /etc/odoo/odoo.conf -d odoo \
|
|
|
141
141
|
|
|
142
142
|
Docker Compose runs both Odoo and PostgreSQL. Odoo is available at http://localhost:8069.
|
|
143
143
|
|
|
144
|
-
### Native development with venv
|
|
145
|
-
|
|
146
|
-
In this workflow, Odoo runs directly on the host using a generated Python virtual environment.
|
|
147
|
-
|
|
148
|
-
Create the workspace with the Odoo source and virtual environment:
|
|
149
|
-
|
|
150
|
-
```bash
|
|
151
|
-
odt-env --init-project ./odoo19 --sync-all --create-venv \
|
|
152
|
-
--set config:db_host=127.0.0.1 \
|
|
153
|
-
--set config:db_name=odoo \
|
|
154
|
-
--set config:db_user=odoo \
|
|
155
|
-
--set config:db_password=odoo
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
> **Note**
|
|
159
|
-
> Make sure PostgreSQL is running at the configured host and the configured database user exists.
|
|
160
|
-
|
|
161
|
-
Start Odoo with the generated script:
|
|
162
|
-
|
|
163
|
-
```bash
|
|
164
|
-
cd ./odoo19
|
|
165
|
-
./odoo-scripts/run.sh
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
Odoo starts with the generated configuration from `./odoo-configs/odoo-server.conf` and is available at http://localhost:8069.
|
|
169
|
-
|
|
170
|
-
---
|
|
171
|
-
|
|
172
|
-
## Usage
|
|
173
|
-
|
|
174
|
-
The examples below use the workspace configuration introduced in the Quick start section.
|
|
175
|
-
|
|
176
|
-
### 1. Docker workflow
|
|
177
|
-
|
|
178
144
|
The Docker workflow uses the following `odoo-project.ini` configuration:
|
|
179
145
|
|
|
180
146
|
```ini
|
|
@@ -200,13 +166,13 @@ base_image = odoo:19.0
|
|
|
200
166
|
|
|
201
167
|
Edit this file when you want to add extra addons, change configuration values, pin repositories, or adjust Python dependency handling.
|
|
202
168
|
|
|
203
|
-
|
|
169
|
+
### 1.1. Adding extra addons
|
|
204
170
|
|
|
205
171
|
To extend Odoo with additional functionality, add extra addons through `[addons.<name>]` sections in `odoo-project.ini`.
|
|
206
172
|
|
|
207
173
|
In this example, we add two Git-based addon repositories, `OCA/web` and `OCA/helpdesk`.
|
|
208
174
|
|
|
209
|
-
|
|
175
|
+
#### 1.1.1. Update the project file
|
|
210
176
|
|
|
211
177
|
Edit `odoo-project.ini` in the workspace root and add these addon sections:
|
|
212
178
|
|
|
@@ -222,7 +188,7 @@ branch = ${odoo:version}
|
|
|
222
188
|
|
|
223
189
|
The rest of the generated project file can stay unchanged.
|
|
224
190
|
|
|
225
|
-
|
|
191
|
+
#### 1.1.2. Sync and install addons
|
|
226
192
|
|
|
227
193
|
|
|
228
194
|
Sync the configured addon repositories and refresh the generated Docker workflow artifacts:
|
|
@@ -251,8 +217,7 @@ For subsequent addon updates, run `click-odoo-update` inside the Odoo container:
|
|
|
251
217
|
docker compose exec odoo click-odoo-update -c /etc/odoo/odoo.conf -d odoo
|
|
252
218
|
```
|
|
253
219
|
|
|
254
|
-
|
|
255
|
-
#### 1.2. Backup and restore
|
|
220
|
+
### 1.2. Backup and restore
|
|
256
221
|
|
|
257
222
|
The Docker workflow generates Unix shell helpers under `ROOT/docker/local/scripts/` for backing up and restoring the PostgreSQL database and Odoo filestore independently:
|
|
258
223
|
|
|
@@ -275,7 +240,7 @@ The default database name is taken from `[config].db_name` when configured, othe
|
|
|
275
240
|
ODOO_DB_NAME=odoo_test ./docker/local/scripts/backup-db.sh
|
|
276
241
|
```
|
|
277
242
|
|
|
278
|
-
|
|
243
|
+
#### 1.2.1. Database backup
|
|
279
244
|
|
|
280
245
|
Create a PostgreSQL custom-format dump under `ROOT/odoo-backups/`:
|
|
281
246
|
|
|
@@ -295,7 +260,7 @@ Pass an output path explicitly when needed:
|
|
|
295
260
|
./docker/local/scripts/backup-db.sh ./odoo-backups/pre-upgrade.dump
|
|
296
261
|
```
|
|
297
262
|
|
|
298
|
-
|
|
263
|
+
#### 1.2.2. Database restore
|
|
299
264
|
|
|
300
265
|
Restore a database dump with `pg_restore`:
|
|
301
266
|
|
|
@@ -317,7 +282,7 @@ To restore the same dump into another database without replacing the default dat
|
|
|
317
282
|
ODOO_DB_NAME=odoo_restore ./docker/local/scripts/restore-db.sh ./odoo-backups/pre-upgrade.dump
|
|
318
283
|
```
|
|
319
284
|
|
|
320
|
-
|
|
285
|
+
#### 1.2.3. Filestore backup
|
|
321
286
|
|
|
322
287
|
Create a compressed tar archive of the selected database filestore:
|
|
323
288
|
|
|
@@ -348,7 +313,7 @@ docker compose stop odoo
|
|
|
348
313
|
docker compose up -d odoo
|
|
349
314
|
```
|
|
350
315
|
|
|
351
|
-
|
|
316
|
+
#### 1.2.4. Filestore restore
|
|
352
317
|
|
|
353
318
|
Restore a filestore archive:
|
|
354
319
|
|
|
@@ -372,7 +337,7 @@ ODOO_DB_NAME=odoo_restore ./docker/local/scripts/restore-filestore.sh ./odoo-bac
|
|
|
372
337
|
|
|
373
338
|
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.
|
|
374
339
|
|
|
375
|
-
|
|
340
|
+
#### 1.2.5. Restic filestore backup
|
|
376
341
|
|
|
377
342
|
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.
|
|
378
343
|
|
|
@@ -420,7 +385,7 @@ List or inspect snapshots through the generic wrapper:
|
|
|
420
385
|
./docker/local/scripts/restic.sh check
|
|
421
386
|
```
|
|
422
387
|
|
|
423
|
-
|
|
388
|
+
#### 1.2.6. Restic filestore restore
|
|
424
389
|
|
|
425
390
|
Restore the latest matching filestore snapshot:
|
|
426
391
|
|
|
@@ -447,7 +412,7 @@ ODOO_DB_NAME=odoo_restore RESTIC_SOURCE_DB_NAME=odoo ./docker/local/scripts/rest
|
|
|
447
412
|
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.
|
|
448
413
|
|
|
449
414
|
|
|
450
|
-
|
|
415
|
+
### 1.3. Creating a Docker deploy build context
|
|
451
416
|
|
|
452
417
|
Use `--create-docker-deploy` to generate a self-contained Docker build context for CI/CD, testing, staging, production, or another non-local deployment workflow.
|
|
453
418
|
|
|
@@ -488,7 +453,31 @@ docker build -t mycompany/odoo:19.0 docker/deploy
|
|
|
488
453
|
|
|
489
454
|
---
|
|
490
455
|
|
|
491
|
-
|
|
456
|
+
## 2. Native development with venv
|
|
457
|
+
|
|
458
|
+
In this workflow, Odoo runs directly on the host using a generated Python virtual environment.
|
|
459
|
+
|
|
460
|
+
Create the workspace with the Odoo source and virtual environment:
|
|
461
|
+
|
|
462
|
+
```bash
|
|
463
|
+
odt-env --init-project ./odoo19 --sync-all --create-venv \
|
|
464
|
+
--set config:db_host=127.0.0.1 \
|
|
465
|
+
--set config:db_name=odoo \
|
|
466
|
+
--set config:db_user=odoo \
|
|
467
|
+
--set config:db_password=odoo
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
> **Note**
|
|
471
|
+
> Make sure PostgreSQL is running at the configured host and the configured database user exists.
|
|
472
|
+
|
|
473
|
+
Start Odoo with the generated script:
|
|
474
|
+
|
|
475
|
+
```bash
|
|
476
|
+
cd ./odoo19
|
|
477
|
+
./odoo-scripts/run.sh
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
Odoo starts with the generated configuration from `./odoo-configs/odoo-server.conf` and is available at http://localhost:8069.
|
|
492
481
|
|
|
493
482
|
The native workflow uses the following `odoo-project.ini` configuration, with PostgreSQL connection settings added to `[config]`:
|
|
494
483
|
|
|
@@ -519,13 +508,13 @@ db_password = odoo
|
|
|
519
508
|
|
|
520
509
|
Edit this file when you want to add extra addons, change configuration values, pin repositories, or adjust Python dependency handling.
|
|
521
510
|
|
|
522
|
-
|
|
511
|
+
### 2.1. Adding extra addons
|
|
523
512
|
|
|
524
513
|
To extend Odoo with additional functionality, add extra addons through `[addons.<name>]` sections in `odoo-project.ini`.
|
|
525
514
|
|
|
526
515
|
In this example, we add two Git-based addon repositories, `OCA/web` and `OCA/helpdesk`.
|
|
527
516
|
|
|
528
|
-
|
|
517
|
+
#### 2.1.1. Update the project file
|
|
529
518
|
|
|
530
519
|
Edit `odoo-project.ini` in the workspace root and add these addon sections:
|
|
531
520
|
|
|
@@ -541,8 +530,7 @@ branch = ${odoo:version}
|
|
|
541
530
|
|
|
542
531
|
The rest of the generated project file can stay unchanged.
|
|
543
532
|
|
|
544
|
-
|
|
545
|
-
|
|
533
|
+
#### 2.1.2. Sync and install addons
|
|
546
534
|
|
|
547
535
|
Sync the sources and recreate the Python environment so dependencies from the new addon repositories are included:
|
|
548
536
|
|
|
@@ -566,14 +554,13 @@ For subsequent addon updates, use the generated update script:
|
|
|
566
554
|
|
|
567
555
|
The generated script uses `click-odoo-update` with the workspace Odoo configuration.
|
|
568
556
|
|
|
569
|
-
|
|
570
|
-
#### 2.2. Using system Python instead of managed Python
|
|
557
|
+
### 2.2. Using system Python instead of managed Python
|
|
571
558
|
|
|
572
559
|
By default, `odt-env` uses `uv` to install and manage the requested Python version.
|
|
573
560
|
|
|
574
561
|
If you already have a suitable system Python installed, you can disable managed Python.
|
|
575
562
|
|
|
576
|
-
|
|
563
|
+
#### 2.2.1. Update the project file
|
|
577
564
|
|
|
578
565
|
Disable managed Python by adding `python_version = 3.11` and `managed_python = false` to the `odoo-project.ini` file.
|
|
579
566
|
|
|
@@ -587,7 +574,7 @@ managed_python = false
|
|
|
587
574
|
python_version = 3.11
|
|
588
575
|
```
|
|
589
576
|
|
|
590
|
-
|
|
577
|
+
#### 2.2.2. Update the workspace
|
|
591
578
|
|
|
592
579
|
After changing the project file, run `odt-env` again from the workspace root:
|
|
593
580
|
|
|
@@ -597,7 +584,7 @@ odt-env --sync-all --create-venv
|
|
|
597
584
|
|
|
598
585
|
This recreates the virtual environment at `ROOT/venv` using the system Python.
|
|
599
586
|
|
|
600
|
-
|
|
587
|
+
### 2.3. Script reference
|
|
601
588
|
|
|
602
589
|
This section describes the native helpers under `ROOT/odoo-scripts/`. Docker backup/restore helpers are documented in the Docker workflow section above.
|
|
603
590
|
|
|
@@ -607,7 +594,7 @@ Native database backup and restore scripts are generated only when `[config].db_
|
|
|
607
594
|
|
|
608
595
|
The examples below use the Unix form.
|
|
609
596
|
|
|
610
|
-
|
|
597
|
+
#### 2.3.1. run
|
|
611
598
|
|
|
612
599
|
Starts Odoo in the foreground.
|
|
613
600
|
|
|
@@ -621,7 +608,7 @@ Examples:
|
|
|
621
608
|
./odoo-scripts/run.sh -i sale,crm --without-demo=all
|
|
622
609
|
```
|
|
623
610
|
|
|
624
|
-
|
|
611
|
+
#### 2.3.2. instance
|
|
625
612
|
|
|
626
613
|
Manages Odoo as a background service on Unix-like systems.
|
|
627
614
|
|
|
@@ -636,7 +623,7 @@ Examples:
|
|
|
636
623
|
./odoo-scripts/instance.sh status
|
|
637
624
|
```
|
|
638
625
|
|
|
639
|
-
|
|
626
|
+
#### 2.3.3. test
|
|
640
627
|
|
|
641
628
|
Runs Odoo tests.
|
|
642
629
|
|
|
@@ -651,7 +638,7 @@ Examples:
|
|
|
651
638
|
./odoo-scripts/test.sh -i sale --test-tags /sale
|
|
652
639
|
```
|
|
653
640
|
|
|
654
|
-
|
|
641
|
+
#### 2.3.4. shell
|
|
655
642
|
|
|
656
643
|
Opens an Odoo shell.
|
|
657
644
|
|
|
@@ -661,7 +648,7 @@ Examples:
|
|
|
661
648
|
./odoo-scripts/shell.sh
|
|
662
649
|
```
|
|
663
650
|
|
|
664
|
-
|
|
651
|
+
#### 2.3.5. backup
|
|
665
652
|
|
|
666
653
|
Creates a timestamped ZIP backup under `ROOT/odoo-backups/`.
|
|
667
654
|
|
|
@@ -673,7 +660,7 @@ Examples:
|
|
|
673
660
|
./odoo-scripts/backup.sh
|
|
674
661
|
```
|
|
675
662
|
|
|
676
|
-
|
|
663
|
+
#### 2.3.6. restore
|
|
677
664
|
|
|
678
665
|
Restores a backup into the configured database.
|
|
679
666
|
|
|
@@ -688,7 +675,7 @@ Examples:
|
|
|
688
675
|
./odoo-scripts/restore.sh ./odoo-backups/odoo_20260331_221443.zip --force
|
|
689
676
|
```
|
|
690
677
|
|
|
691
|
-
|
|
678
|
+
#### 2.3.7. update
|
|
692
679
|
|
|
693
680
|
Updates an Odoo database automatically detecting addons to update based on a hash of their file content.
|
|
694
681
|
|
|
@@ -701,8 +688,9 @@ Examples:
|
|
|
701
688
|
./odoo-scripts/update.sh --update-all
|
|
702
689
|
```
|
|
703
690
|
|
|
691
|
+
---
|
|
704
692
|
|
|
705
|
-
|
|
693
|
+
## 3. Managing Python requirements
|
|
706
694
|
|
|
707
695
|
The `[virtualenv]` section controls additional Python dependencies used when provisioning both the native virtual environment and generated Docker images.
|
|
708
696
|
|
|
@@ -715,7 +703,7 @@ Use:
|
|
|
715
703
|
|
|
716
704
|
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
705
|
|
|
718
|
-
|
|
706
|
+
### 3.1. Add or pin packages
|
|
719
707
|
|
|
720
708
|
Use `requirements` to install additional packages or to force a specific version:
|
|
721
709
|
|
|
@@ -728,7 +716,7 @@ requirements =
|
|
|
728
716
|
|
|
729
717
|
In this example, both packages are included in the generated dependency set and pinned to the specified versions.
|
|
730
718
|
|
|
731
|
-
|
|
719
|
+
### 3.2. Override a package with a different one
|
|
732
720
|
|
|
733
721
|
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
722
|
|
|
@@ -746,7 +734,7 @@ In this example, `odt-env` installs `psycopg2-binary==2.9.9` and skips `psycopg2
|
|
|
746
734
|
|
|
747
735
|
---
|
|
748
736
|
|
|
749
|
-
|
|
737
|
+
## 4. Creating portable workspace bundles
|
|
750
738
|
|
|
751
739
|
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.
|
|
752
740
|
|
|
@@ -764,7 +752,7 @@ The bundle does not contain the virtual environment, database data, logs, backup
|
|
|
764
752
|
|
|
765
753
|
Those machine-specific outputs are recreated on the target machine.
|
|
766
754
|
|
|
767
|
-
|
|
755
|
+
### 4.1. Create a bundle on the build machine
|
|
768
756
|
|
|
769
757
|
On an internet-connected build machine, sync the sources, build the wheelhouse, and create the bundle in one command:
|
|
770
758
|
|
|
@@ -784,7 +772,7 @@ You can also select an explicit output file:
|
|
|
784
772
|
odt-env --sync-all --create-venv --create-bundle ./artifacts/odoo18-production.odt.zip
|
|
785
773
|
```
|
|
786
774
|
|
|
787
|
-
|
|
775
|
+
#### 4.1.1. Including uncommitted changes
|
|
788
776
|
|
|
789
777
|
By default, bundle creation stops when a bundled Git repository has uncommitted changes.
|
|
790
778
|
|
|
@@ -794,7 +782,7 @@ To intentionally include those changes in the bundle, use:
|
|
|
794
782
|
odt-env --sync-all --create-venv --create-bundle --allow-dirty-bundle
|
|
795
783
|
```
|
|
796
784
|
|
|
797
|
-
|
|
785
|
+
### 4.2. Create the workspace on the target machine
|
|
798
786
|
|
|
799
787
|
Copy the ZIP to the target machine and import it into an empty directory:
|
|
800
788
|
|
|
@@ -821,7 +809,7 @@ The import operation:
|
|
|
821
809
|
> **Compatibility note**
|
|
822
810
|
> 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`.
|
|
823
811
|
|
|
824
|
-
|
|
812
|
+
### 4.3. Manual wheelhouse workflow
|
|
825
813
|
|
|
826
814
|
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:
|
|
827
815
|
|
|
@@ -1140,5 +1128,3 @@ db_user = odoo
|
|
|
1140
1128
|
db_password = odoo
|
|
1141
1129
|
http_port = 8069
|
|
1142
1130
|
```
|
|
1143
|
-
|
|
1144
|
-
---
|
|
@@ -78,7 +78,7 @@ odt-env --help
|
|
|
78
78
|
|
|
79
79
|
---
|
|
80
80
|
|
|
81
|
-
##
|
|
81
|
+
## Usage
|
|
82
82
|
|
|
83
83
|
`odt-env` supports two development workflows:
|
|
84
84
|
|
|
@@ -87,7 +87,7 @@ odt-env --help
|
|
|
87
87
|
|
|
88
88
|
Choose the workflow that fits your environment. Both use the same `odoo-project.ini` project definition.
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
## 1. Docker workflow
|
|
91
91
|
|
|
92
92
|
Create a new workspace:
|
|
93
93
|
|
|
@@ -113,40 +113,6 @@ docker compose run --rm odoo -- -c /etc/odoo/odoo.conf -d odoo \
|
|
|
113
113
|
|
|
114
114
|
Docker Compose runs both Odoo and PostgreSQL. Odoo is available at http://localhost:8069.
|
|
115
115
|
|
|
116
|
-
### Native development with venv
|
|
117
|
-
|
|
118
|
-
In this workflow, Odoo runs directly on the host using a generated Python virtual environment.
|
|
119
|
-
|
|
120
|
-
Create the workspace with the Odoo source and virtual environment:
|
|
121
|
-
|
|
122
|
-
```bash
|
|
123
|
-
odt-env --init-project ./odoo19 --sync-all --create-venv \
|
|
124
|
-
--set config:db_host=127.0.0.1 \
|
|
125
|
-
--set config:db_name=odoo \
|
|
126
|
-
--set config:db_user=odoo \
|
|
127
|
-
--set config:db_password=odoo
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
> **Note**
|
|
131
|
-
> Make sure PostgreSQL is running at the configured host and the configured database user exists.
|
|
132
|
-
|
|
133
|
-
Start Odoo with the generated script:
|
|
134
|
-
|
|
135
|
-
```bash
|
|
136
|
-
cd ./odoo19
|
|
137
|
-
./odoo-scripts/run.sh
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
Odoo starts with the generated configuration from `./odoo-configs/odoo-server.conf` and is available at http://localhost:8069.
|
|
141
|
-
|
|
142
|
-
---
|
|
143
|
-
|
|
144
|
-
## Usage
|
|
145
|
-
|
|
146
|
-
The examples below use the workspace configuration introduced in the Quick start section.
|
|
147
|
-
|
|
148
|
-
### 1. Docker workflow
|
|
149
|
-
|
|
150
116
|
The Docker workflow uses the following `odoo-project.ini` configuration:
|
|
151
117
|
|
|
152
118
|
```ini
|
|
@@ -172,13 +138,13 @@ base_image = odoo:19.0
|
|
|
172
138
|
|
|
173
139
|
Edit this file when you want to add extra addons, change configuration values, pin repositories, or adjust Python dependency handling.
|
|
174
140
|
|
|
175
|
-
|
|
141
|
+
### 1.1. Adding extra addons
|
|
176
142
|
|
|
177
143
|
To extend Odoo with additional functionality, add extra addons through `[addons.<name>]` sections in `odoo-project.ini`.
|
|
178
144
|
|
|
179
145
|
In this example, we add two Git-based addon repositories, `OCA/web` and `OCA/helpdesk`.
|
|
180
146
|
|
|
181
|
-
|
|
147
|
+
#### 1.1.1. Update the project file
|
|
182
148
|
|
|
183
149
|
Edit `odoo-project.ini` in the workspace root and add these addon sections:
|
|
184
150
|
|
|
@@ -194,7 +160,7 @@ branch = ${odoo:version}
|
|
|
194
160
|
|
|
195
161
|
The rest of the generated project file can stay unchanged.
|
|
196
162
|
|
|
197
|
-
|
|
163
|
+
#### 1.1.2. Sync and install addons
|
|
198
164
|
|
|
199
165
|
|
|
200
166
|
Sync the configured addon repositories and refresh the generated Docker workflow artifacts:
|
|
@@ -223,8 +189,7 @@ For subsequent addon updates, run `click-odoo-update` inside the Odoo container:
|
|
|
223
189
|
docker compose exec odoo click-odoo-update -c /etc/odoo/odoo.conf -d odoo
|
|
224
190
|
```
|
|
225
191
|
|
|
226
|
-
|
|
227
|
-
#### 1.2. Backup and restore
|
|
192
|
+
### 1.2. Backup and restore
|
|
228
193
|
|
|
229
194
|
The Docker workflow generates Unix shell helpers under `ROOT/docker/local/scripts/` for backing up and restoring the PostgreSQL database and Odoo filestore independently:
|
|
230
195
|
|
|
@@ -247,7 +212,7 @@ The default database name is taken from `[config].db_name` when configured, othe
|
|
|
247
212
|
ODOO_DB_NAME=odoo_test ./docker/local/scripts/backup-db.sh
|
|
248
213
|
```
|
|
249
214
|
|
|
250
|
-
|
|
215
|
+
#### 1.2.1. Database backup
|
|
251
216
|
|
|
252
217
|
Create a PostgreSQL custom-format dump under `ROOT/odoo-backups/`:
|
|
253
218
|
|
|
@@ -267,7 +232,7 @@ Pass an output path explicitly when needed:
|
|
|
267
232
|
./docker/local/scripts/backup-db.sh ./odoo-backups/pre-upgrade.dump
|
|
268
233
|
```
|
|
269
234
|
|
|
270
|
-
|
|
235
|
+
#### 1.2.2. Database restore
|
|
271
236
|
|
|
272
237
|
Restore a database dump with `pg_restore`:
|
|
273
238
|
|
|
@@ -289,7 +254,7 @@ To restore the same dump into another database without replacing the default dat
|
|
|
289
254
|
ODOO_DB_NAME=odoo_restore ./docker/local/scripts/restore-db.sh ./odoo-backups/pre-upgrade.dump
|
|
290
255
|
```
|
|
291
256
|
|
|
292
|
-
|
|
257
|
+
#### 1.2.3. Filestore backup
|
|
293
258
|
|
|
294
259
|
Create a compressed tar archive of the selected database filestore:
|
|
295
260
|
|
|
@@ -320,7 +285,7 @@ docker compose stop odoo
|
|
|
320
285
|
docker compose up -d odoo
|
|
321
286
|
```
|
|
322
287
|
|
|
323
|
-
|
|
288
|
+
#### 1.2.4. Filestore restore
|
|
324
289
|
|
|
325
290
|
Restore a filestore archive:
|
|
326
291
|
|
|
@@ -344,7 +309,7 @@ ODOO_DB_NAME=odoo_restore ./docker/local/scripts/restore-filestore.sh ./odoo-bac
|
|
|
344
309
|
|
|
345
310
|
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.
|
|
346
311
|
|
|
347
|
-
|
|
312
|
+
#### 1.2.5. Restic filestore backup
|
|
348
313
|
|
|
349
314
|
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.
|
|
350
315
|
|
|
@@ -392,7 +357,7 @@ List or inspect snapshots through the generic wrapper:
|
|
|
392
357
|
./docker/local/scripts/restic.sh check
|
|
393
358
|
```
|
|
394
359
|
|
|
395
|
-
|
|
360
|
+
#### 1.2.6. Restic filestore restore
|
|
396
361
|
|
|
397
362
|
Restore the latest matching filestore snapshot:
|
|
398
363
|
|
|
@@ -419,7 +384,7 @@ ODOO_DB_NAME=odoo_restore RESTIC_SOURCE_DB_NAME=odoo ./docker/local/scripts/rest
|
|
|
419
384
|
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.
|
|
420
385
|
|
|
421
386
|
|
|
422
|
-
|
|
387
|
+
### 1.3. Creating a Docker deploy build context
|
|
423
388
|
|
|
424
389
|
Use `--create-docker-deploy` to generate a self-contained Docker build context for CI/CD, testing, staging, production, or another non-local deployment workflow.
|
|
425
390
|
|
|
@@ -460,7 +425,31 @@ docker build -t mycompany/odoo:19.0 docker/deploy
|
|
|
460
425
|
|
|
461
426
|
---
|
|
462
427
|
|
|
463
|
-
|
|
428
|
+
## 2. Native development with venv
|
|
429
|
+
|
|
430
|
+
In this workflow, Odoo runs directly on the host using a generated Python virtual environment.
|
|
431
|
+
|
|
432
|
+
Create the workspace with the Odoo source and virtual environment:
|
|
433
|
+
|
|
434
|
+
```bash
|
|
435
|
+
odt-env --init-project ./odoo19 --sync-all --create-venv \
|
|
436
|
+
--set config:db_host=127.0.0.1 \
|
|
437
|
+
--set config:db_name=odoo \
|
|
438
|
+
--set config:db_user=odoo \
|
|
439
|
+
--set config:db_password=odoo
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
> **Note**
|
|
443
|
+
> Make sure PostgreSQL is running at the configured host and the configured database user exists.
|
|
444
|
+
|
|
445
|
+
Start Odoo with the generated script:
|
|
446
|
+
|
|
447
|
+
```bash
|
|
448
|
+
cd ./odoo19
|
|
449
|
+
./odoo-scripts/run.sh
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
Odoo starts with the generated configuration from `./odoo-configs/odoo-server.conf` and is available at http://localhost:8069.
|
|
464
453
|
|
|
465
454
|
The native workflow uses the following `odoo-project.ini` configuration, with PostgreSQL connection settings added to `[config]`:
|
|
466
455
|
|
|
@@ -491,13 +480,13 @@ db_password = odoo
|
|
|
491
480
|
|
|
492
481
|
Edit this file when you want to add extra addons, change configuration values, pin repositories, or adjust Python dependency handling.
|
|
493
482
|
|
|
494
|
-
|
|
483
|
+
### 2.1. Adding extra addons
|
|
495
484
|
|
|
496
485
|
To extend Odoo with additional functionality, add extra addons through `[addons.<name>]` sections in `odoo-project.ini`.
|
|
497
486
|
|
|
498
487
|
In this example, we add two Git-based addon repositories, `OCA/web` and `OCA/helpdesk`.
|
|
499
488
|
|
|
500
|
-
|
|
489
|
+
#### 2.1.1. Update the project file
|
|
501
490
|
|
|
502
491
|
Edit `odoo-project.ini` in the workspace root and add these addon sections:
|
|
503
492
|
|
|
@@ -513,8 +502,7 @@ branch = ${odoo:version}
|
|
|
513
502
|
|
|
514
503
|
The rest of the generated project file can stay unchanged.
|
|
515
504
|
|
|
516
|
-
|
|
517
|
-
|
|
505
|
+
#### 2.1.2. Sync and install addons
|
|
518
506
|
|
|
519
507
|
Sync the sources and recreate the Python environment so dependencies from the new addon repositories are included:
|
|
520
508
|
|
|
@@ -538,14 +526,13 @@ For subsequent addon updates, use the generated update script:
|
|
|
538
526
|
|
|
539
527
|
The generated script uses `click-odoo-update` with the workspace Odoo configuration.
|
|
540
528
|
|
|
541
|
-
|
|
542
|
-
#### 2.2. Using system Python instead of managed Python
|
|
529
|
+
### 2.2. Using system Python instead of managed Python
|
|
543
530
|
|
|
544
531
|
By default, `odt-env` uses `uv` to install and manage the requested Python version.
|
|
545
532
|
|
|
546
533
|
If you already have a suitable system Python installed, you can disable managed Python.
|
|
547
534
|
|
|
548
|
-
|
|
535
|
+
#### 2.2.1. Update the project file
|
|
549
536
|
|
|
550
537
|
Disable managed Python by adding `python_version = 3.11` and `managed_python = false` to the `odoo-project.ini` file.
|
|
551
538
|
|
|
@@ -559,7 +546,7 @@ managed_python = false
|
|
|
559
546
|
python_version = 3.11
|
|
560
547
|
```
|
|
561
548
|
|
|
562
|
-
|
|
549
|
+
#### 2.2.2. Update the workspace
|
|
563
550
|
|
|
564
551
|
After changing the project file, run `odt-env` again from the workspace root:
|
|
565
552
|
|
|
@@ -569,7 +556,7 @@ odt-env --sync-all --create-venv
|
|
|
569
556
|
|
|
570
557
|
This recreates the virtual environment at `ROOT/venv` using the system Python.
|
|
571
558
|
|
|
572
|
-
|
|
559
|
+
### 2.3. Script reference
|
|
573
560
|
|
|
574
561
|
This section describes the native helpers under `ROOT/odoo-scripts/`. Docker backup/restore helpers are documented in the Docker workflow section above.
|
|
575
562
|
|
|
@@ -579,7 +566,7 @@ Native database backup and restore scripts are generated only when `[config].db_
|
|
|
579
566
|
|
|
580
567
|
The examples below use the Unix form.
|
|
581
568
|
|
|
582
|
-
|
|
569
|
+
#### 2.3.1. run
|
|
583
570
|
|
|
584
571
|
Starts Odoo in the foreground.
|
|
585
572
|
|
|
@@ -593,7 +580,7 @@ Examples:
|
|
|
593
580
|
./odoo-scripts/run.sh -i sale,crm --without-demo=all
|
|
594
581
|
```
|
|
595
582
|
|
|
596
|
-
|
|
583
|
+
#### 2.3.2. instance
|
|
597
584
|
|
|
598
585
|
Manages Odoo as a background service on Unix-like systems.
|
|
599
586
|
|
|
@@ -608,7 +595,7 @@ Examples:
|
|
|
608
595
|
./odoo-scripts/instance.sh status
|
|
609
596
|
```
|
|
610
597
|
|
|
611
|
-
|
|
598
|
+
#### 2.3.3. test
|
|
612
599
|
|
|
613
600
|
Runs Odoo tests.
|
|
614
601
|
|
|
@@ -623,7 +610,7 @@ Examples:
|
|
|
623
610
|
./odoo-scripts/test.sh -i sale --test-tags /sale
|
|
624
611
|
```
|
|
625
612
|
|
|
626
|
-
|
|
613
|
+
#### 2.3.4. shell
|
|
627
614
|
|
|
628
615
|
Opens an Odoo shell.
|
|
629
616
|
|
|
@@ -633,7 +620,7 @@ Examples:
|
|
|
633
620
|
./odoo-scripts/shell.sh
|
|
634
621
|
```
|
|
635
622
|
|
|
636
|
-
|
|
623
|
+
#### 2.3.5. backup
|
|
637
624
|
|
|
638
625
|
Creates a timestamped ZIP backup under `ROOT/odoo-backups/`.
|
|
639
626
|
|
|
@@ -645,7 +632,7 @@ Examples:
|
|
|
645
632
|
./odoo-scripts/backup.sh
|
|
646
633
|
```
|
|
647
634
|
|
|
648
|
-
|
|
635
|
+
#### 2.3.6. restore
|
|
649
636
|
|
|
650
637
|
Restores a backup into the configured database.
|
|
651
638
|
|
|
@@ -660,7 +647,7 @@ Examples:
|
|
|
660
647
|
./odoo-scripts/restore.sh ./odoo-backups/odoo_20260331_221443.zip --force
|
|
661
648
|
```
|
|
662
649
|
|
|
663
|
-
|
|
650
|
+
#### 2.3.7. update
|
|
664
651
|
|
|
665
652
|
Updates an Odoo database automatically detecting addons to update based on a hash of their file content.
|
|
666
653
|
|
|
@@ -673,8 +660,9 @@ Examples:
|
|
|
673
660
|
./odoo-scripts/update.sh --update-all
|
|
674
661
|
```
|
|
675
662
|
|
|
663
|
+
---
|
|
676
664
|
|
|
677
|
-
|
|
665
|
+
## 3. Managing Python requirements
|
|
678
666
|
|
|
679
667
|
The `[virtualenv]` section controls additional Python dependencies used when provisioning both the native virtual environment and generated Docker images.
|
|
680
668
|
|
|
@@ -687,7 +675,7 @@ Use:
|
|
|
687
675
|
|
|
688
676
|
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`.
|
|
689
677
|
|
|
690
|
-
|
|
678
|
+
### 3.1. Add or pin packages
|
|
691
679
|
|
|
692
680
|
Use `requirements` to install additional packages or to force a specific version:
|
|
693
681
|
|
|
@@ -700,7 +688,7 @@ requirements =
|
|
|
700
688
|
|
|
701
689
|
In this example, both packages are included in the generated dependency set and pinned to the specified versions.
|
|
702
690
|
|
|
703
|
-
|
|
691
|
+
### 3.2. Override a package with a different one
|
|
704
692
|
|
|
705
693
|
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`.
|
|
706
694
|
|
|
@@ -718,7 +706,7 @@ In this example, `odt-env` installs `psycopg2-binary==2.9.9` and skips `psycopg2
|
|
|
718
706
|
|
|
719
707
|
---
|
|
720
708
|
|
|
721
|
-
|
|
709
|
+
## 4. Creating portable workspace bundles
|
|
722
710
|
|
|
723
711
|
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.
|
|
724
712
|
|
|
@@ -736,7 +724,7 @@ The bundle does not contain the virtual environment, database data, logs, backup
|
|
|
736
724
|
|
|
737
725
|
Those machine-specific outputs are recreated on the target machine.
|
|
738
726
|
|
|
739
|
-
|
|
727
|
+
### 4.1. Create a bundle on the build machine
|
|
740
728
|
|
|
741
729
|
On an internet-connected build machine, sync the sources, build the wheelhouse, and create the bundle in one command:
|
|
742
730
|
|
|
@@ -756,7 +744,7 @@ You can also select an explicit output file:
|
|
|
756
744
|
odt-env --sync-all --create-venv --create-bundle ./artifacts/odoo18-production.odt.zip
|
|
757
745
|
```
|
|
758
746
|
|
|
759
|
-
|
|
747
|
+
#### 4.1.1. Including uncommitted changes
|
|
760
748
|
|
|
761
749
|
By default, bundle creation stops when a bundled Git repository has uncommitted changes.
|
|
762
750
|
|
|
@@ -766,7 +754,7 @@ To intentionally include those changes in the bundle, use:
|
|
|
766
754
|
odt-env --sync-all --create-venv --create-bundle --allow-dirty-bundle
|
|
767
755
|
```
|
|
768
756
|
|
|
769
|
-
|
|
757
|
+
### 4.2. Create the workspace on the target machine
|
|
770
758
|
|
|
771
759
|
Copy the ZIP to the target machine and import it into an empty directory:
|
|
772
760
|
|
|
@@ -793,7 +781,7 @@ The import operation:
|
|
|
793
781
|
> **Compatibility note**
|
|
794
782
|
> 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`.
|
|
795
783
|
|
|
796
|
-
|
|
784
|
+
### 4.3. Manual wheelhouse workflow
|
|
797
785
|
|
|
798
786
|
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:
|
|
799
787
|
|
|
@@ -1112,5 +1100,3 @@ db_user = odoo
|
|
|
1112
1100
|
db_password = odoo
|
|
1113
1101
|
http_port = 8069
|
|
1114
1102
|
```
|
|
1115
|
-
|
|
1116
|
-
---
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.20.4"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: odoo-devops-tools
|
|
3
|
-
Version: 1.20.
|
|
3
|
+
Version: 1.20.4
|
|
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
|
|
@@ -106,7 +106,7 @@ odt-env --help
|
|
|
106
106
|
|
|
107
107
|
---
|
|
108
108
|
|
|
109
|
-
##
|
|
109
|
+
## Usage
|
|
110
110
|
|
|
111
111
|
`odt-env` supports two development workflows:
|
|
112
112
|
|
|
@@ -115,7 +115,7 @@ odt-env --help
|
|
|
115
115
|
|
|
116
116
|
Choose the workflow that fits your environment. Both use the same `odoo-project.ini` project definition.
|
|
117
117
|
|
|
118
|
-
|
|
118
|
+
## 1. Docker workflow
|
|
119
119
|
|
|
120
120
|
Create a new workspace:
|
|
121
121
|
|
|
@@ -141,40 +141,6 @@ docker compose run --rm odoo -- -c /etc/odoo/odoo.conf -d odoo \
|
|
|
141
141
|
|
|
142
142
|
Docker Compose runs both Odoo and PostgreSQL. Odoo is available at http://localhost:8069.
|
|
143
143
|
|
|
144
|
-
### Native development with venv
|
|
145
|
-
|
|
146
|
-
In this workflow, Odoo runs directly on the host using a generated Python virtual environment.
|
|
147
|
-
|
|
148
|
-
Create the workspace with the Odoo source and virtual environment:
|
|
149
|
-
|
|
150
|
-
```bash
|
|
151
|
-
odt-env --init-project ./odoo19 --sync-all --create-venv \
|
|
152
|
-
--set config:db_host=127.0.0.1 \
|
|
153
|
-
--set config:db_name=odoo \
|
|
154
|
-
--set config:db_user=odoo \
|
|
155
|
-
--set config:db_password=odoo
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
> **Note**
|
|
159
|
-
> Make sure PostgreSQL is running at the configured host and the configured database user exists.
|
|
160
|
-
|
|
161
|
-
Start Odoo with the generated script:
|
|
162
|
-
|
|
163
|
-
```bash
|
|
164
|
-
cd ./odoo19
|
|
165
|
-
./odoo-scripts/run.sh
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
Odoo starts with the generated configuration from `./odoo-configs/odoo-server.conf` and is available at http://localhost:8069.
|
|
169
|
-
|
|
170
|
-
---
|
|
171
|
-
|
|
172
|
-
## Usage
|
|
173
|
-
|
|
174
|
-
The examples below use the workspace configuration introduced in the Quick start section.
|
|
175
|
-
|
|
176
|
-
### 1. Docker workflow
|
|
177
|
-
|
|
178
144
|
The Docker workflow uses the following `odoo-project.ini` configuration:
|
|
179
145
|
|
|
180
146
|
```ini
|
|
@@ -200,13 +166,13 @@ base_image = odoo:19.0
|
|
|
200
166
|
|
|
201
167
|
Edit this file when you want to add extra addons, change configuration values, pin repositories, or adjust Python dependency handling.
|
|
202
168
|
|
|
203
|
-
|
|
169
|
+
### 1.1. Adding extra addons
|
|
204
170
|
|
|
205
171
|
To extend Odoo with additional functionality, add extra addons through `[addons.<name>]` sections in `odoo-project.ini`.
|
|
206
172
|
|
|
207
173
|
In this example, we add two Git-based addon repositories, `OCA/web` and `OCA/helpdesk`.
|
|
208
174
|
|
|
209
|
-
|
|
175
|
+
#### 1.1.1. Update the project file
|
|
210
176
|
|
|
211
177
|
Edit `odoo-project.ini` in the workspace root and add these addon sections:
|
|
212
178
|
|
|
@@ -222,7 +188,7 @@ branch = ${odoo:version}
|
|
|
222
188
|
|
|
223
189
|
The rest of the generated project file can stay unchanged.
|
|
224
190
|
|
|
225
|
-
|
|
191
|
+
#### 1.1.2. Sync and install addons
|
|
226
192
|
|
|
227
193
|
|
|
228
194
|
Sync the configured addon repositories and refresh the generated Docker workflow artifacts:
|
|
@@ -251,8 +217,7 @@ For subsequent addon updates, run `click-odoo-update` inside the Odoo container:
|
|
|
251
217
|
docker compose exec odoo click-odoo-update -c /etc/odoo/odoo.conf -d odoo
|
|
252
218
|
```
|
|
253
219
|
|
|
254
|
-
|
|
255
|
-
#### 1.2. Backup and restore
|
|
220
|
+
### 1.2. Backup and restore
|
|
256
221
|
|
|
257
222
|
The Docker workflow generates Unix shell helpers under `ROOT/docker/local/scripts/` for backing up and restoring the PostgreSQL database and Odoo filestore independently:
|
|
258
223
|
|
|
@@ -275,7 +240,7 @@ The default database name is taken from `[config].db_name` when configured, othe
|
|
|
275
240
|
ODOO_DB_NAME=odoo_test ./docker/local/scripts/backup-db.sh
|
|
276
241
|
```
|
|
277
242
|
|
|
278
|
-
|
|
243
|
+
#### 1.2.1. Database backup
|
|
279
244
|
|
|
280
245
|
Create a PostgreSQL custom-format dump under `ROOT/odoo-backups/`:
|
|
281
246
|
|
|
@@ -295,7 +260,7 @@ Pass an output path explicitly when needed:
|
|
|
295
260
|
./docker/local/scripts/backup-db.sh ./odoo-backups/pre-upgrade.dump
|
|
296
261
|
```
|
|
297
262
|
|
|
298
|
-
|
|
263
|
+
#### 1.2.2. Database restore
|
|
299
264
|
|
|
300
265
|
Restore a database dump with `pg_restore`:
|
|
301
266
|
|
|
@@ -317,7 +282,7 @@ To restore the same dump into another database without replacing the default dat
|
|
|
317
282
|
ODOO_DB_NAME=odoo_restore ./docker/local/scripts/restore-db.sh ./odoo-backups/pre-upgrade.dump
|
|
318
283
|
```
|
|
319
284
|
|
|
320
|
-
|
|
285
|
+
#### 1.2.3. Filestore backup
|
|
321
286
|
|
|
322
287
|
Create a compressed tar archive of the selected database filestore:
|
|
323
288
|
|
|
@@ -348,7 +313,7 @@ docker compose stop odoo
|
|
|
348
313
|
docker compose up -d odoo
|
|
349
314
|
```
|
|
350
315
|
|
|
351
|
-
|
|
316
|
+
#### 1.2.4. Filestore restore
|
|
352
317
|
|
|
353
318
|
Restore a filestore archive:
|
|
354
319
|
|
|
@@ -372,7 +337,7 @@ ODOO_DB_NAME=odoo_restore ./docker/local/scripts/restore-filestore.sh ./odoo-bac
|
|
|
372
337
|
|
|
373
338
|
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.
|
|
374
339
|
|
|
375
|
-
|
|
340
|
+
#### 1.2.5. Restic filestore backup
|
|
376
341
|
|
|
377
342
|
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.
|
|
378
343
|
|
|
@@ -420,7 +385,7 @@ List or inspect snapshots through the generic wrapper:
|
|
|
420
385
|
./docker/local/scripts/restic.sh check
|
|
421
386
|
```
|
|
422
387
|
|
|
423
|
-
|
|
388
|
+
#### 1.2.6. Restic filestore restore
|
|
424
389
|
|
|
425
390
|
Restore the latest matching filestore snapshot:
|
|
426
391
|
|
|
@@ -447,7 +412,7 @@ ODOO_DB_NAME=odoo_restore RESTIC_SOURCE_DB_NAME=odoo ./docker/local/scripts/rest
|
|
|
447
412
|
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.
|
|
448
413
|
|
|
449
414
|
|
|
450
|
-
|
|
415
|
+
### 1.3. Creating a Docker deploy build context
|
|
451
416
|
|
|
452
417
|
Use `--create-docker-deploy` to generate a self-contained Docker build context for CI/CD, testing, staging, production, or another non-local deployment workflow.
|
|
453
418
|
|
|
@@ -488,7 +453,31 @@ docker build -t mycompany/odoo:19.0 docker/deploy
|
|
|
488
453
|
|
|
489
454
|
---
|
|
490
455
|
|
|
491
|
-
|
|
456
|
+
## 2. Native development with venv
|
|
457
|
+
|
|
458
|
+
In this workflow, Odoo runs directly on the host using a generated Python virtual environment.
|
|
459
|
+
|
|
460
|
+
Create the workspace with the Odoo source and virtual environment:
|
|
461
|
+
|
|
462
|
+
```bash
|
|
463
|
+
odt-env --init-project ./odoo19 --sync-all --create-venv \
|
|
464
|
+
--set config:db_host=127.0.0.1 \
|
|
465
|
+
--set config:db_name=odoo \
|
|
466
|
+
--set config:db_user=odoo \
|
|
467
|
+
--set config:db_password=odoo
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
> **Note**
|
|
471
|
+
> Make sure PostgreSQL is running at the configured host and the configured database user exists.
|
|
472
|
+
|
|
473
|
+
Start Odoo with the generated script:
|
|
474
|
+
|
|
475
|
+
```bash
|
|
476
|
+
cd ./odoo19
|
|
477
|
+
./odoo-scripts/run.sh
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
Odoo starts with the generated configuration from `./odoo-configs/odoo-server.conf` and is available at http://localhost:8069.
|
|
492
481
|
|
|
493
482
|
The native workflow uses the following `odoo-project.ini` configuration, with PostgreSQL connection settings added to `[config]`:
|
|
494
483
|
|
|
@@ -519,13 +508,13 @@ db_password = odoo
|
|
|
519
508
|
|
|
520
509
|
Edit this file when you want to add extra addons, change configuration values, pin repositories, or adjust Python dependency handling.
|
|
521
510
|
|
|
522
|
-
|
|
511
|
+
### 2.1. Adding extra addons
|
|
523
512
|
|
|
524
513
|
To extend Odoo with additional functionality, add extra addons through `[addons.<name>]` sections in `odoo-project.ini`.
|
|
525
514
|
|
|
526
515
|
In this example, we add two Git-based addon repositories, `OCA/web` and `OCA/helpdesk`.
|
|
527
516
|
|
|
528
|
-
|
|
517
|
+
#### 2.1.1. Update the project file
|
|
529
518
|
|
|
530
519
|
Edit `odoo-project.ini` in the workspace root and add these addon sections:
|
|
531
520
|
|
|
@@ -541,8 +530,7 @@ branch = ${odoo:version}
|
|
|
541
530
|
|
|
542
531
|
The rest of the generated project file can stay unchanged.
|
|
543
532
|
|
|
544
|
-
|
|
545
|
-
|
|
533
|
+
#### 2.1.2. Sync and install addons
|
|
546
534
|
|
|
547
535
|
Sync the sources and recreate the Python environment so dependencies from the new addon repositories are included:
|
|
548
536
|
|
|
@@ -566,14 +554,13 @@ For subsequent addon updates, use the generated update script:
|
|
|
566
554
|
|
|
567
555
|
The generated script uses `click-odoo-update` with the workspace Odoo configuration.
|
|
568
556
|
|
|
569
|
-
|
|
570
|
-
#### 2.2. Using system Python instead of managed Python
|
|
557
|
+
### 2.2. Using system Python instead of managed Python
|
|
571
558
|
|
|
572
559
|
By default, `odt-env` uses `uv` to install and manage the requested Python version.
|
|
573
560
|
|
|
574
561
|
If you already have a suitable system Python installed, you can disable managed Python.
|
|
575
562
|
|
|
576
|
-
|
|
563
|
+
#### 2.2.1. Update the project file
|
|
577
564
|
|
|
578
565
|
Disable managed Python by adding `python_version = 3.11` and `managed_python = false` to the `odoo-project.ini` file.
|
|
579
566
|
|
|
@@ -587,7 +574,7 @@ managed_python = false
|
|
|
587
574
|
python_version = 3.11
|
|
588
575
|
```
|
|
589
576
|
|
|
590
|
-
|
|
577
|
+
#### 2.2.2. Update the workspace
|
|
591
578
|
|
|
592
579
|
After changing the project file, run `odt-env` again from the workspace root:
|
|
593
580
|
|
|
@@ -597,7 +584,7 @@ odt-env --sync-all --create-venv
|
|
|
597
584
|
|
|
598
585
|
This recreates the virtual environment at `ROOT/venv` using the system Python.
|
|
599
586
|
|
|
600
|
-
|
|
587
|
+
### 2.3. Script reference
|
|
601
588
|
|
|
602
589
|
This section describes the native helpers under `ROOT/odoo-scripts/`. Docker backup/restore helpers are documented in the Docker workflow section above.
|
|
603
590
|
|
|
@@ -607,7 +594,7 @@ Native database backup and restore scripts are generated only when `[config].db_
|
|
|
607
594
|
|
|
608
595
|
The examples below use the Unix form.
|
|
609
596
|
|
|
610
|
-
|
|
597
|
+
#### 2.3.1. run
|
|
611
598
|
|
|
612
599
|
Starts Odoo in the foreground.
|
|
613
600
|
|
|
@@ -621,7 +608,7 @@ Examples:
|
|
|
621
608
|
./odoo-scripts/run.sh -i sale,crm --without-demo=all
|
|
622
609
|
```
|
|
623
610
|
|
|
624
|
-
|
|
611
|
+
#### 2.3.2. instance
|
|
625
612
|
|
|
626
613
|
Manages Odoo as a background service on Unix-like systems.
|
|
627
614
|
|
|
@@ -636,7 +623,7 @@ Examples:
|
|
|
636
623
|
./odoo-scripts/instance.sh status
|
|
637
624
|
```
|
|
638
625
|
|
|
639
|
-
|
|
626
|
+
#### 2.3.3. test
|
|
640
627
|
|
|
641
628
|
Runs Odoo tests.
|
|
642
629
|
|
|
@@ -651,7 +638,7 @@ Examples:
|
|
|
651
638
|
./odoo-scripts/test.sh -i sale --test-tags /sale
|
|
652
639
|
```
|
|
653
640
|
|
|
654
|
-
|
|
641
|
+
#### 2.3.4. shell
|
|
655
642
|
|
|
656
643
|
Opens an Odoo shell.
|
|
657
644
|
|
|
@@ -661,7 +648,7 @@ Examples:
|
|
|
661
648
|
./odoo-scripts/shell.sh
|
|
662
649
|
```
|
|
663
650
|
|
|
664
|
-
|
|
651
|
+
#### 2.3.5. backup
|
|
665
652
|
|
|
666
653
|
Creates a timestamped ZIP backup under `ROOT/odoo-backups/`.
|
|
667
654
|
|
|
@@ -673,7 +660,7 @@ Examples:
|
|
|
673
660
|
./odoo-scripts/backup.sh
|
|
674
661
|
```
|
|
675
662
|
|
|
676
|
-
|
|
663
|
+
#### 2.3.6. restore
|
|
677
664
|
|
|
678
665
|
Restores a backup into the configured database.
|
|
679
666
|
|
|
@@ -688,7 +675,7 @@ Examples:
|
|
|
688
675
|
./odoo-scripts/restore.sh ./odoo-backups/odoo_20260331_221443.zip --force
|
|
689
676
|
```
|
|
690
677
|
|
|
691
|
-
|
|
678
|
+
#### 2.3.7. update
|
|
692
679
|
|
|
693
680
|
Updates an Odoo database automatically detecting addons to update based on a hash of their file content.
|
|
694
681
|
|
|
@@ -701,8 +688,9 @@ Examples:
|
|
|
701
688
|
./odoo-scripts/update.sh --update-all
|
|
702
689
|
```
|
|
703
690
|
|
|
691
|
+
---
|
|
704
692
|
|
|
705
|
-
|
|
693
|
+
## 3. Managing Python requirements
|
|
706
694
|
|
|
707
695
|
The `[virtualenv]` section controls additional Python dependencies used when provisioning both the native virtual environment and generated Docker images.
|
|
708
696
|
|
|
@@ -715,7 +703,7 @@ Use:
|
|
|
715
703
|
|
|
716
704
|
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
705
|
|
|
718
|
-
|
|
706
|
+
### 3.1. Add or pin packages
|
|
719
707
|
|
|
720
708
|
Use `requirements` to install additional packages or to force a specific version:
|
|
721
709
|
|
|
@@ -728,7 +716,7 @@ requirements =
|
|
|
728
716
|
|
|
729
717
|
In this example, both packages are included in the generated dependency set and pinned to the specified versions.
|
|
730
718
|
|
|
731
|
-
|
|
719
|
+
### 3.2. Override a package with a different one
|
|
732
720
|
|
|
733
721
|
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
722
|
|
|
@@ -746,7 +734,7 @@ In this example, `odt-env` installs `psycopg2-binary==2.9.9` and skips `psycopg2
|
|
|
746
734
|
|
|
747
735
|
---
|
|
748
736
|
|
|
749
|
-
|
|
737
|
+
## 4. Creating portable workspace bundles
|
|
750
738
|
|
|
751
739
|
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.
|
|
752
740
|
|
|
@@ -764,7 +752,7 @@ The bundle does not contain the virtual environment, database data, logs, backup
|
|
|
764
752
|
|
|
765
753
|
Those machine-specific outputs are recreated on the target machine.
|
|
766
754
|
|
|
767
|
-
|
|
755
|
+
### 4.1. Create a bundle on the build machine
|
|
768
756
|
|
|
769
757
|
On an internet-connected build machine, sync the sources, build the wheelhouse, and create the bundle in one command:
|
|
770
758
|
|
|
@@ -784,7 +772,7 @@ You can also select an explicit output file:
|
|
|
784
772
|
odt-env --sync-all --create-venv --create-bundle ./artifacts/odoo18-production.odt.zip
|
|
785
773
|
```
|
|
786
774
|
|
|
787
|
-
|
|
775
|
+
#### 4.1.1. Including uncommitted changes
|
|
788
776
|
|
|
789
777
|
By default, bundle creation stops when a bundled Git repository has uncommitted changes.
|
|
790
778
|
|
|
@@ -794,7 +782,7 @@ To intentionally include those changes in the bundle, use:
|
|
|
794
782
|
odt-env --sync-all --create-venv --create-bundle --allow-dirty-bundle
|
|
795
783
|
```
|
|
796
784
|
|
|
797
|
-
|
|
785
|
+
### 4.2. Create the workspace on the target machine
|
|
798
786
|
|
|
799
787
|
Copy the ZIP to the target machine and import it into an empty directory:
|
|
800
788
|
|
|
@@ -821,7 +809,7 @@ The import operation:
|
|
|
821
809
|
> **Compatibility note**
|
|
822
810
|
> 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`.
|
|
823
811
|
|
|
824
|
-
|
|
812
|
+
### 4.3. Manual wheelhouse workflow
|
|
825
813
|
|
|
826
814
|
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:
|
|
827
815
|
|
|
@@ -1140,5 +1128,3 @@ db_user = odoo
|
|
|
1140
1128
|
db_password = odoo
|
|
1141
1129
|
http_port = 8069
|
|
1142
1130
|
```
|
|
1143
|
-
|
|
1144
|
-
---
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "1.20.3"
|
|
File without changes
|
|
File without changes
|
{odoo_devops_tools-1.20.3 → odoo_devops_tools-1.20.4}/odoo_devops_tools.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{odoo_devops_tools-1.20.3 → odoo_devops_tools-1.20.4}/odoo_devops_tools.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{odoo_devops_tools-1.20.3 → odoo_devops_tools-1.20.4}/odoo_devops_tools.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|