odoobuddy 0.1.0__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.
- odoobuddy-0.1.0/.gitignore +12 -0
- odoobuddy-0.1.0/CHANGELOG.md +19 -0
- odoobuddy-0.1.0/LICENSE +21 -0
- odoobuddy-0.1.0/PKG-INFO +200 -0
- odoobuddy-0.1.0/README.md +163 -0
- odoobuddy-0.1.0/pyproject.toml +75 -0
- odoobuddy-0.1.0/src/odoobuddy/__init__.py +3 -0
- odoobuddy-0.1.0/src/odoobuddy/__main__.py +3 -0
- odoobuddy-0.1.0/src/odoobuddy/cli.py +725 -0
- odoobuddy-0.1.0/src/odoobuddy/ide.py +81 -0
- odoobuddy-0.1.0/src/odoobuddy/installer.py +417 -0
- odoobuddy-0.1.0/src/odoobuddy/layout.py +93 -0
- odoobuddy-0.1.0/src/odoobuddy/models.py +142 -0
- odoobuddy-0.1.0/src/odoobuddy/operations.py +455 -0
- odoobuddy-0.1.0/src/odoobuddy/ports.py +49 -0
- odoobuddy-0.1.0/src/odoobuddy/postgres.py +88 -0
- odoobuddy-0.1.0/src/odoobuddy/py.typed +0 -0
- odoobuddy-0.1.0/src/odoobuddy/registry.py +147 -0
- odoobuddy-0.1.0/src/odoobuddy/render.py +275 -0
- odoobuddy-0.1.0/src/odoobuddy/repos.py +138 -0
- odoobuddy-0.1.0/src/odoobuddy/sources.py +159 -0
- odoobuddy-0.1.0/src/odoobuddy/system.py +219 -0
- odoobuddy-0.1.0/src/odoobuddy/ui.py +147 -0
- odoobuddy-0.1.0/src/odoobuddy/versions.py +53 -0
- odoobuddy-0.1.0/src/odoobuddy/wizard.py +423 -0
- odoobuddy-0.1.0/tests/__init__.py +0 -0
- odoobuddy-0.1.0/tests/conftest.py +97 -0
- odoobuddy-0.1.0/tests/test_basics.py +263 -0
- odoobuddy-0.1.0/tests/test_cli.py +105 -0
- odoobuddy-0.1.0/tests/test_installer.py +229 -0
- odoobuddy-0.1.0/tests/test_operations.py +162 -0
- odoobuddy-0.1.0/tests/test_registry.py +102 -0
- odoobuddy-0.1.0/tests/test_repos.py +165 -0
- odoobuddy-0.1.0/tests/test_wizard.py +243 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.1.0] - unreleased
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- Interactive install wizard for local and server mode, with a flag for every question.
|
|
7
|
+
- Odoo versions read live from GitHub, and the matching Python installed via uv.
|
|
8
|
+
- Enterprise support with a GitHub token check and fallback to Community.
|
|
9
|
+
- Multiple instances per machine, with automatic port allocation.
|
|
10
|
+
- Server mode: systemd, Nginx (websocket), Let's Encrypt, ufw, log rotation, tuned workers.
|
|
11
|
+
- VS Code and PyCharm debug configurations for local instances.
|
|
12
|
+
- No database is created for you: the install is verified by installing `contacts` in a
|
|
13
|
+
temporary database, which is then deleted; create your own in the database manager.
|
|
14
|
+
- Installed IDEs (VS Code, PyCharm) are detected and pre-selected; PyCharm gets a full project.
|
|
15
|
+
- Each instance is self-contained: odoo/odoo, odoo/enterprise, custom/, conf/ in one folder.
|
|
16
|
+
- Custom repositories: cloned during install or later with `odoobuddy NAME clone URL [BRANCH]`,
|
|
17
|
+
with automatic addons_path and requirements; `repos` lists them, `update` pulls them.
|
|
18
|
+
- `odoobuddy NAME COMMAND` works as well as `odoobuddy COMMAND NAME`.
|
|
19
|
+
- Commands: list, info, use, start, stop, restart, logs, shell, update, backup, restore, remove, doctor, versions.
|
odoobuddy-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 niyasraphy
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
odoobuddy-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: odoobuddy
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Install and manage multiple Odoo instances (any version, Community or Enterprise) on your computer or on production servers, with Nginx, SSL and IDE setup.
|
|
5
|
+
Project-URL: Homepage, https://github.com/niyasraphy/odoobuddy
|
|
6
|
+
Project-URL: Issues, https://github.com/niyasraphy/odoobuddy/issues
|
|
7
|
+
Author-email: niyasraphy <niyasraphyk@gmail.com>
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: cli,deployment,devops,erp,installer,letsencrypt,nginx,odoo
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Framework :: Odoo
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: System Administrators
|
|
16
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Topic :: System :: Installation/Setup
|
|
23
|
+
Classifier: Topic :: System :: Systems Administration
|
|
24
|
+
Requires-Python: >=3.10
|
|
25
|
+
Requires-Dist: questionary>=2.0
|
|
26
|
+
Requires-Dist: rich>=13
|
|
27
|
+
Requires-Dist: typer>=0.12
|
|
28
|
+
Requires-Dist: uv>=0.4
|
|
29
|
+
Provides-Extra: dev
|
|
30
|
+
Requires-Dist: build>=1.2; extra == 'dev'
|
|
31
|
+
Requires-Dist: mypy>=1.11; extra == 'dev'
|
|
32
|
+
Requires-Dist: pytest-cov>=5; extra == 'dev'
|
|
33
|
+
Requires-Dist: pytest>=8; extra == 'dev'
|
|
34
|
+
Requires-Dist: ruff>=0.6; extra == 'dev'
|
|
35
|
+
Requires-Dist: twine>=5; extra == 'dev'
|
|
36
|
+
Description-Content-Type: text/markdown
|
|
37
|
+
|
|
38
|
+
# odoobuddy
|
|
39
|
+
|
|
40
|
+
**Install and manage many Odoo instances, of any version, on your laptop or on production servers, with one command.**
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pip install odoobuddy
|
|
44
|
+
odoobuddy
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
The wizard asks a few questions, then sets up everything:
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
? Where are you installing Odoo? Local - my computer, for development
|
|
51
|
+
? Which Odoo version? Odoo 19.0
|
|
52
|
+
? Which edition? Enterprise
|
|
53
|
+
? GitHub token with access to odoo/enterprise (input hidden): ****
|
|
54
|
+
✓ access to odoo/enterprise confirmed
|
|
55
|
+
? Instance name: shop
|
|
56
|
+
? Which port should Odoo run on? 8069
|
|
57
|
+
? Which IDE do you use? PyCharm (ready run configuration) - ✓ installed
|
|
58
|
+
|
|
59
|
+
✓ [8/10] Test installation (contacts in a temporary database) (1m 12s)
|
|
60
|
+
|
|
61
|
+
╭──────────────── shop · Odoo 19.0 Enterprise ─────────────────╮
|
|
62
|
+
│ ✓ Odoo 19.0 is installed and working │
|
|
63
|
+
│ │
|
|
64
|
+
│ Create your first database │
|
|
65
|
+
│ 1. Open http://localhost:8069/web/database/manager │
|
|
66
|
+
│ 2. Master password: x8Kf2... │
|
|
67
|
+
│ 3. Choose name, language, country, demo data, admin login │
|
|
68
|
+
╰──────────────────────────────────────────────────────────────╯
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
The installer **does not create your database**. It proves the setup works by installing
|
|
72
|
+
a real module (`contacts`) in a temporary database, deletes it, and lets you create your
|
|
73
|
+
own databases in Odoo's database manager, choosing the name, language, country, demo data
|
|
74
|
+
and admin password yourself.
|
|
75
|
+
|
|
76
|
+
> `odoobuddy` is a community project and is **not affiliated with Odoo S.A.**
|
|
77
|
+
|
|
78
|
+
## Features
|
|
79
|
+
|
|
80
|
+
- **Any Odoo version, read live from Odoo's GitHub.** 16.0 through 20.0 today, and new releases appear automatically.
|
|
81
|
+
- **Community or Enterprise.** Your GitHub token is checked *before* cloning. If it doesn't have access, the wizard offers to retry or continues with Community. The token is never saved to disk, git config or logs.
|
|
82
|
+
- **Many instances side by side.** Run Odoo 17, 18, 19 and 20 at the same time, or several instances of one version. Each instance gets its own Python environment, config, database user, ports, filestore and logs.
|
|
83
|
+
- **The right Python for each version**, installed automatically with [uv](https://github.com/astral-sh/uv). Odoo 16 gets 3.10 and Odoo 19 gets 3.12, with no system Python changes.
|
|
84
|
+
- **Local mode** for development: ready-to-debug **VS Code** (`F5`) or **PyCharm** projects, dev mode with auto-reload, and a `start.sh` script. Installed IDEs are detected and pre-selected. Your IDE is never installed or changed; only `.vscode/` or `.idea/` is written in the instance folder.
|
|
85
|
+
- **Server mode** for production:
|
|
86
|
+
- a dedicated system user and a **systemd** service
|
|
87
|
+
- **Nginx** with websocket support
|
|
88
|
+
- free **Let's Encrypt SSL**, after checking that your domain points to the server
|
|
89
|
+
- a **ufw firewall** that never locks out your SSH port
|
|
90
|
+
- worker counts tuned to your CPU and RAM
|
|
91
|
+
- log rotation
|
|
92
|
+
- **Always clear which Odoo you are touching.** Every command shows a banner, production instances are labelled in red, and destructive commands make you type the instance name.
|
|
93
|
+
- **Safe by default.** `--dry-run` everywhere, a backup before production updates, generated passwords, and SQL and passwords passed on stdin, never on the command line.
|
|
94
|
+
|
|
95
|
+
## Requirements
|
|
96
|
+
|
|
97
|
+
- Linux: **Ubuntu 22.04 / 24.04** or **Debian 12** (others may work, untested)
|
|
98
|
+
- Python 3.10+ to run `odoobuddy` itself
|
|
99
|
+
- `sudo` rights (system packages and PostgreSQL); server mode must run as root
|
|
100
|
+
|
|
101
|
+
## Managing instances
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
odoobuddy list # all instances, versions, ports and status
|
|
105
|
+
odoobuddy info shop # paths, ports, database, source code
|
|
106
|
+
odoobuddy use shop # set the "current" instance
|
|
107
|
+
|
|
108
|
+
odoobuddy start|stop|restart shop
|
|
109
|
+
odoobuddy logs shop # follow the log (-n 500 --no-follow also work)
|
|
110
|
+
odoobuddy shell shop # Odoo shell with `env` (--db to pick a database)
|
|
111
|
+
|
|
112
|
+
odoobuddy update shop # pull latest code + upgrade modules in every database
|
|
113
|
+
odoobuddy backup shop # database + filestore → zip (Odoo's own format)
|
|
114
|
+
odoobuddy restore backup.zip --name shop --db shop_copy
|
|
115
|
+
odoobuddy remove shop # asks you to type "shop" to confirm
|
|
116
|
+
|
|
117
|
+
odoobuddy doctor # check the system and every instance
|
|
118
|
+
odoobuddy versions # Odoo versions available to install
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Which instance does a command use?
|
|
122
|
+
|
|
123
|
+
1. The name you type: `odoobuddy logs shop`
|
|
124
|
+
2. Otherwise, the instance folder you are in (`cd ~/odoo/shop/addons/my_module`)
|
|
125
|
+
3. Otherwise, the one chosen with `odoobuddy use shop`
|
|
126
|
+
4. Otherwise, it asks you to pick from a list. It never guesses.
|
|
127
|
+
|
|
128
|
+
## Where things go
|
|
129
|
+
|
|
130
|
+
Everything about an instance lives in **one folder**:
|
|
131
|
+
|
|
132
|
+
```
|
|
133
|
+
~/odoo/testing20/ (server: /opt/odoobuddy/instances/testing20/)
|
|
134
|
+
├── odoo/
|
|
135
|
+
│ ├── odoo/ ← Odoo Community (branch 20.0, latest commit only)
|
|
136
|
+
│ └── enterprise/ ← Odoo Enterprise (if chosen)
|
|
137
|
+
├── custom/
|
|
138
|
+
│ ├── addons/ ← your own loose modules
|
|
139
|
+
│ ├── web/ ← cloned repositories (odoobuddy testing20 clone URL)
|
|
140
|
+
│ └── my-company-modules/
|
|
141
|
+
├── conf/
|
|
142
|
+
│ └── odoo.conf ← configuration (ports, DB user, addons_path, master password)
|
|
143
|
+
├── venv/ ← this instance's own Python
|
|
144
|
+
├── data/filestore/<db>/ ← attachments of each database (server: /var/lib/odoo/<name>/)
|
|
145
|
+
├── logs/odoo.log ← log (server: /var/log/odoo/<name>.log)
|
|
146
|
+
├── backups/ ← backup zips (server: /var/backups/odoobuddy/<name>/)
|
|
147
|
+
├── start.sh ← run in the terminal (local)
|
|
148
|
+
├── .idea/ or .vscode/ ← PyCharm or VS Code project (local)
|
|
149
|
+
└── .odoobuddy ← marks the folder, so commands know which instance you're in
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
`addons_path` order: `odoo/enterprise` → `custom/addons` → each cloned repository → Community.
|
|
153
|
+
Repositories are scanned for modules, so both OCA-style repos (modules at the root) and
|
|
154
|
+
repos with an `addons/` subfolder work.
|
|
155
|
+
|
|
156
|
+
On servers, each instance also has a system user `odoo-<name>`, a service `odoo-<name>.service`
|
|
157
|
+
and, with a domain, `/etc/nginx/sites-available/odoo-<name>.conf`. Every instance has its own
|
|
158
|
+
PostgreSQL user `odoo_<name>`, which can only see its own databases.
|
|
159
|
+
|
|
160
|
+
## Custom module repositories
|
|
161
|
+
|
|
162
|
+
The wizard asks whether to clone repositories during installation. You can also add them later:
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
odoobuddy testing20 clone https://github.com/OCA/web.git # branch = Odoo version
|
|
166
|
+
odoobuddy testing20 clone git@github.com:acme/odoo-addons.git 20.0
|
|
167
|
+
odoobuddy testing20 repos # list them
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Each repository is cloned into `custom/`, its `requirements.txt` is installed into the
|
|
171
|
+
instance's Python, and `addons_path` in `conf/odoo.conf` is updated; your other edits to
|
|
172
|
+
the file are kept. For private https repositories you are asked for an access token. It is
|
|
173
|
+
used for that clone only and never saved. SSH URLs use your SSH keys.
|
|
174
|
+
`odoobuddy update` also pulls every repository.
|
|
175
|
+
|
|
176
|
+
## Automation (no questions)
|
|
177
|
+
|
|
178
|
+
Every question has a flag. For example:
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
export ODOO_GITHUB_TOKEN=ghp_... # only for Enterprise
|
|
182
|
+
sudo -E odoobuddy install --mode server --version 19.0 --edition enterprise \
|
|
183
|
+
--name shop --port 8069 --domain erp.example.com --ssl \
|
|
184
|
+
--email admin@example.com --workers 5 --firewall \
|
|
185
|
+
--repo https://github.com/OCA/web.git --repo git@github.com:acme/addons.git#19.0 --yes
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Add `--dry-run` to see every command without running anything.
|
|
189
|
+
|
|
190
|
+
## Development
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
python -m venv .venv && source .venv/bin/activate
|
|
194
|
+
pip install -e '.[dev]'
|
|
195
|
+
pytest && ruff check . && mypy
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
## License
|
|
199
|
+
|
|
200
|
+
MIT
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# odoobuddy
|
|
2
|
+
|
|
3
|
+
**Install and manage many Odoo instances, of any version, on your laptop or on production servers, with one command.**
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
pip install odoobuddy
|
|
7
|
+
odoobuddy
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
The wizard asks a few questions, then sets up everything:
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
? Where are you installing Odoo? Local - my computer, for development
|
|
14
|
+
? Which Odoo version? Odoo 19.0
|
|
15
|
+
? Which edition? Enterprise
|
|
16
|
+
? GitHub token with access to odoo/enterprise (input hidden): ****
|
|
17
|
+
✓ access to odoo/enterprise confirmed
|
|
18
|
+
? Instance name: shop
|
|
19
|
+
? Which port should Odoo run on? 8069
|
|
20
|
+
? Which IDE do you use? PyCharm (ready run configuration) - ✓ installed
|
|
21
|
+
|
|
22
|
+
✓ [8/10] Test installation (contacts in a temporary database) (1m 12s)
|
|
23
|
+
|
|
24
|
+
╭──────────────── shop · Odoo 19.0 Enterprise ─────────────────╮
|
|
25
|
+
│ ✓ Odoo 19.0 is installed and working │
|
|
26
|
+
│ │
|
|
27
|
+
│ Create your first database │
|
|
28
|
+
│ 1. Open http://localhost:8069/web/database/manager │
|
|
29
|
+
│ 2. Master password: x8Kf2... │
|
|
30
|
+
│ 3. Choose name, language, country, demo data, admin login │
|
|
31
|
+
╰──────────────────────────────────────────────────────────────╯
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
The installer **does not create your database**. It proves the setup works by installing
|
|
35
|
+
a real module (`contacts`) in a temporary database, deletes it, and lets you create your
|
|
36
|
+
own databases in Odoo's database manager, choosing the name, language, country, demo data
|
|
37
|
+
and admin password yourself.
|
|
38
|
+
|
|
39
|
+
> `odoobuddy` is a community project and is **not affiliated with Odoo S.A.**
|
|
40
|
+
|
|
41
|
+
## Features
|
|
42
|
+
|
|
43
|
+
- **Any Odoo version, read live from Odoo's GitHub.** 16.0 through 20.0 today, and new releases appear automatically.
|
|
44
|
+
- **Community or Enterprise.** Your GitHub token is checked *before* cloning. If it doesn't have access, the wizard offers to retry or continues with Community. The token is never saved to disk, git config or logs.
|
|
45
|
+
- **Many instances side by side.** Run Odoo 17, 18, 19 and 20 at the same time, or several instances of one version. Each instance gets its own Python environment, config, database user, ports, filestore and logs.
|
|
46
|
+
- **The right Python for each version**, installed automatically with [uv](https://github.com/astral-sh/uv). Odoo 16 gets 3.10 and Odoo 19 gets 3.12, with no system Python changes.
|
|
47
|
+
- **Local mode** for development: ready-to-debug **VS Code** (`F5`) or **PyCharm** projects, dev mode with auto-reload, and a `start.sh` script. Installed IDEs are detected and pre-selected. Your IDE is never installed or changed; only `.vscode/` or `.idea/` is written in the instance folder.
|
|
48
|
+
- **Server mode** for production:
|
|
49
|
+
- a dedicated system user and a **systemd** service
|
|
50
|
+
- **Nginx** with websocket support
|
|
51
|
+
- free **Let's Encrypt SSL**, after checking that your domain points to the server
|
|
52
|
+
- a **ufw firewall** that never locks out your SSH port
|
|
53
|
+
- worker counts tuned to your CPU and RAM
|
|
54
|
+
- log rotation
|
|
55
|
+
- **Always clear which Odoo you are touching.** Every command shows a banner, production instances are labelled in red, and destructive commands make you type the instance name.
|
|
56
|
+
- **Safe by default.** `--dry-run` everywhere, a backup before production updates, generated passwords, and SQL and passwords passed on stdin, never on the command line.
|
|
57
|
+
|
|
58
|
+
## Requirements
|
|
59
|
+
|
|
60
|
+
- Linux: **Ubuntu 22.04 / 24.04** or **Debian 12** (others may work, untested)
|
|
61
|
+
- Python 3.10+ to run `odoobuddy` itself
|
|
62
|
+
- `sudo` rights (system packages and PostgreSQL); server mode must run as root
|
|
63
|
+
|
|
64
|
+
## Managing instances
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
odoobuddy list # all instances, versions, ports and status
|
|
68
|
+
odoobuddy info shop # paths, ports, database, source code
|
|
69
|
+
odoobuddy use shop # set the "current" instance
|
|
70
|
+
|
|
71
|
+
odoobuddy start|stop|restart shop
|
|
72
|
+
odoobuddy logs shop # follow the log (-n 500 --no-follow also work)
|
|
73
|
+
odoobuddy shell shop # Odoo shell with `env` (--db to pick a database)
|
|
74
|
+
|
|
75
|
+
odoobuddy update shop # pull latest code + upgrade modules in every database
|
|
76
|
+
odoobuddy backup shop # database + filestore → zip (Odoo's own format)
|
|
77
|
+
odoobuddy restore backup.zip --name shop --db shop_copy
|
|
78
|
+
odoobuddy remove shop # asks you to type "shop" to confirm
|
|
79
|
+
|
|
80
|
+
odoobuddy doctor # check the system and every instance
|
|
81
|
+
odoobuddy versions # Odoo versions available to install
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Which instance does a command use?
|
|
85
|
+
|
|
86
|
+
1. The name you type: `odoobuddy logs shop`
|
|
87
|
+
2. Otherwise, the instance folder you are in (`cd ~/odoo/shop/addons/my_module`)
|
|
88
|
+
3. Otherwise, the one chosen with `odoobuddy use shop`
|
|
89
|
+
4. Otherwise, it asks you to pick from a list. It never guesses.
|
|
90
|
+
|
|
91
|
+
## Where things go
|
|
92
|
+
|
|
93
|
+
Everything about an instance lives in **one folder**:
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
~/odoo/testing20/ (server: /opt/odoobuddy/instances/testing20/)
|
|
97
|
+
├── odoo/
|
|
98
|
+
│ ├── odoo/ ← Odoo Community (branch 20.0, latest commit only)
|
|
99
|
+
│ └── enterprise/ ← Odoo Enterprise (if chosen)
|
|
100
|
+
├── custom/
|
|
101
|
+
│ ├── addons/ ← your own loose modules
|
|
102
|
+
│ ├── web/ ← cloned repositories (odoobuddy testing20 clone URL)
|
|
103
|
+
│ └── my-company-modules/
|
|
104
|
+
├── conf/
|
|
105
|
+
│ └── odoo.conf ← configuration (ports, DB user, addons_path, master password)
|
|
106
|
+
├── venv/ ← this instance's own Python
|
|
107
|
+
├── data/filestore/<db>/ ← attachments of each database (server: /var/lib/odoo/<name>/)
|
|
108
|
+
├── logs/odoo.log ← log (server: /var/log/odoo/<name>.log)
|
|
109
|
+
├── backups/ ← backup zips (server: /var/backups/odoobuddy/<name>/)
|
|
110
|
+
├── start.sh ← run in the terminal (local)
|
|
111
|
+
├── .idea/ or .vscode/ ← PyCharm or VS Code project (local)
|
|
112
|
+
└── .odoobuddy ← marks the folder, so commands know which instance you're in
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
`addons_path` order: `odoo/enterprise` → `custom/addons` → each cloned repository → Community.
|
|
116
|
+
Repositories are scanned for modules, so both OCA-style repos (modules at the root) and
|
|
117
|
+
repos with an `addons/` subfolder work.
|
|
118
|
+
|
|
119
|
+
On servers, each instance also has a system user `odoo-<name>`, a service `odoo-<name>.service`
|
|
120
|
+
and, with a domain, `/etc/nginx/sites-available/odoo-<name>.conf`. Every instance has its own
|
|
121
|
+
PostgreSQL user `odoo_<name>`, which can only see its own databases.
|
|
122
|
+
|
|
123
|
+
## Custom module repositories
|
|
124
|
+
|
|
125
|
+
The wizard asks whether to clone repositories during installation. You can also add them later:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
odoobuddy testing20 clone https://github.com/OCA/web.git # branch = Odoo version
|
|
129
|
+
odoobuddy testing20 clone git@github.com:acme/odoo-addons.git 20.0
|
|
130
|
+
odoobuddy testing20 repos # list them
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Each repository is cloned into `custom/`, its `requirements.txt` is installed into the
|
|
134
|
+
instance's Python, and `addons_path` in `conf/odoo.conf` is updated; your other edits to
|
|
135
|
+
the file are kept. For private https repositories you are asked for an access token. It is
|
|
136
|
+
used for that clone only and never saved. SSH URLs use your SSH keys.
|
|
137
|
+
`odoobuddy update` also pulls every repository.
|
|
138
|
+
|
|
139
|
+
## Automation (no questions)
|
|
140
|
+
|
|
141
|
+
Every question has a flag. For example:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
export ODOO_GITHUB_TOKEN=ghp_... # only for Enterprise
|
|
145
|
+
sudo -E odoobuddy install --mode server --version 19.0 --edition enterprise \
|
|
146
|
+
--name shop --port 8069 --domain erp.example.com --ssl \
|
|
147
|
+
--email admin@example.com --workers 5 --firewall \
|
|
148
|
+
--repo https://github.com/OCA/web.git --repo git@github.com:acme/addons.git#19.0 --yes
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Add `--dry-run` to see every command without running anything.
|
|
152
|
+
|
|
153
|
+
## Development
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
python -m venv .venv && source .venv/bin/activate
|
|
157
|
+
pip install -e '.[dev]'
|
|
158
|
+
pytest && ruff check . && mypy
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## License
|
|
162
|
+
|
|
163
|
+
MIT
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling>=1.24"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "odoobuddy"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "Install and manage multiple Odoo instances (any version, Community or Enterprise) on your computer or on production servers, with Nginx, SSL and IDE setup."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
license-files = ["LICENSE"]
|
|
13
|
+
authors = [{ name = "niyasraphy", email = "niyasraphyk@gmail.com" }]
|
|
14
|
+
keywords = ["odoo", "installer", "erp", "deployment", "nginx", "letsencrypt", "devops", "cli"]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Development Status :: 3 - Alpha",
|
|
17
|
+
"Environment :: Console",
|
|
18
|
+
"Framework :: Odoo",
|
|
19
|
+
"Intended Audience :: Developers",
|
|
20
|
+
"Intended Audience :: System Administrators",
|
|
21
|
+
"Operating System :: POSIX :: Linux",
|
|
22
|
+
"Programming Language :: Python :: 3",
|
|
23
|
+
"Programming Language :: Python :: 3.10",
|
|
24
|
+
"Programming Language :: Python :: 3.11",
|
|
25
|
+
"Programming Language :: Python :: 3.12",
|
|
26
|
+
"Programming Language :: Python :: 3.13",
|
|
27
|
+
"Topic :: System :: Installation/Setup",
|
|
28
|
+
"Topic :: System :: Systems Administration",
|
|
29
|
+
]
|
|
30
|
+
dependencies = [
|
|
31
|
+
"typer>=0.12",
|
|
32
|
+
"rich>=13",
|
|
33
|
+
"questionary>=2.0",
|
|
34
|
+
"uv>=0.4",
|
|
35
|
+
]
|
|
36
|
+
|
|
37
|
+
[project.optional-dependencies]
|
|
38
|
+
dev = ["pytest>=8", "pytest-cov>=5", "ruff>=0.6", "mypy>=1.11", "build>=1.2", "twine>=5"]
|
|
39
|
+
|
|
40
|
+
[project.scripts]
|
|
41
|
+
odoobuddy = "odoobuddy.cli:run"
|
|
42
|
+
|
|
43
|
+
[project.urls]
|
|
44
|
+
Homepage = "https://github.com/niyasraphy/odoobuddy"
|
|
45
|
+
Issues = "https://github.com/niyasraphy/odoobuddy/issues"
|
|
46
|
+
|
|
47
|
+
[tool.hatch.version]
|
|
48
|
+
path = "src/odoobuddy/__init__.py"
|
|
49
|
+
|
|
50
|
+
[tool.hatch.build.targets.sdist]
|
|
51
|
+
include = ["src", "tests", "README.md", "CHANGELOG.md", "LICENSE"]
|
|
52
|
+
|
|
53
|
+
[tool.pytest.ini_options]
|
|
54
|
+
testpaths = ["tests"]
|
|
55
|
+
addopts = "--cov=odoobuddy --cov-report=term-missing"
|
|
56
|
+
|
|
57
|
+
[tool.ruff]
|
|
58
|
+
line-length = 110
|
|
59
|
+
target-version = "py310"
|
|
60
|
+
|
|
61
|
+
[tool.ruff.lint]
|
|
62
|
+
select = ["E", "F", "W", "I", "B", "UP", "SIM", "RUF"]
|
|
63
|
+
ignore = [
|
|
64
|
+
"B008", # typer.Option() in defaults is how typer works
|
|
65
|
+
"UP045", # Optional[...] is required by typer on Python 3.10
|
|
66
|
+
"UP007",
|
|
67
|
+
]
|
|
68
|
+
|
|
69
|
+
[tool.ruff.format]
|
|
70
|
+
exclude = ["*.md"]
|
|
71
|
+
|
|
72
|
+
[tool.mypy]
|
|
73
|
+
files = ["src"]
|
|
74
|
+
strict = true
|
|
75
|
+
ignore_missing_imports = true
|