A build backend for Odoo modules supporting multiple versions
Project description
Polytropos
{ width="400" style="display: block; margin: 0 auto;" }
Polytropos is a Python build backend for Odoo modules that enables writing code once and using it across multiple Odoo versions.
Features
- Multi-version support: Write your module once, target multiple Odoo releases
- Conditional manifests: Configure different manifest values per Odoo version, to let you include or exclude XML files per version (views, assets or other data)
- Editable installs: Develop in editable mode with full version support
- PEP 517 compliant: Works with any PEP 517 compatible frontend
Quick Example
[build-system]
requires = ["polytropos"]
build-backend = "polytropos.build"
[project]
name = "odoo-addon-my-module"
version = "1.0.0"
dependencies = [
"odoo>=17.0" # Specify supported Odoo versions here
]
[tool.polytropos]
default_odoo_release = "18.0"
# All versions have this data
[[tool.polytropos.manifest]]
depends = ["base"]
data = ["data/views.xml"]
# In Odoo 18+, there are special permissions
[[tool.polytropos.manifest]]
releases = ">=18"
data = ["security/ir.model.access.csv"]
Installation
Python will auto-install the build backend to do the build.
But yes, you can install a small CLI with:
pip install polytropos
For development, the recommended tool you need is uv. Then:
uvx polytropos --help-all
Why Polytropos?
Odoo modules traditionally require separate codebases for each version. Polytropos solves this by generating version-specific code at build time, allowing you to maintain a single codebase.
If your product is the combination of Odoo + its release, you probably won't need Polytropos.
If your product are Odoo addons, and you want to provide the same product to your customers regardless of the Odoo version they're running, then you will benefit a lot by Polytropos.
Examples
Check out the examples folder for real-world modules with views, models, and tests that exercise the conditional logic.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file polytropos-2.0.0.tar.gz.
File metadata
- Download URL: polytropos-2.0.0.tar.gz
- Upload date:
- Size: 97.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.29 {"installer":{"name":"uv","version":"0.9.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"NixOS","version":"25.11","id":"xantusia","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07f9ae3b80c3306dee6c8cadd813029deb9357bd3a918327639935790840bc6d
|
|
| MD5 |
fd9bfcfcb53441d11dbc60fd59c44b5c
|
|
| BLAKE2b-256 |
b68f6c66034c3e94a993849b433e7b2ef994f7f05a9166f7b95d6ed988ce380a
|
File details
Details for the file polytropos-2.0.0-py3-none-any.whl.
File metadata
- Download URL: polytropos-2.0.0-py3-none-any.whl
- Upload date:
- Size: 14.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.29 {"installer":{"name":"uv","version":"0.9.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"NixOS","version":"25.11","id":"xantusia","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a2b7e45634a1604d3f2e6d0119befe07d4f8782c8ea38e5bc9005724aeb5b89
|
|
| MD5 |
142d22ade534c05f446f698c31e05001
|
|
| BLAKE2b-256 |
9df4d8c2630853ef4d66d27563d96a19d109bbfe2f654987c61baea176cef445
|