Skip to main content

A build backend for Odoo modules supporting multiple versions

Project description

Polytropos

Polytropos logo{ 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

polytropos-2.0.4.tar.gz (98.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

polytropos-2.0.4-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file polytropos-2.0.4.tar.gz.

File metadata

  • Download URL: polytropos-2.0.4.tar.gz
  • Upload date:
  • Size: 98.5 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":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for polytropos-2.0.4.tar.gz
Algorithm Hash digest
SHA256 0c0d19c38858f604f847332c058cb6bfaeea3c144ead63f5f992d9ac577de2bc
MD5 a8cbbff604bdc70b0dbb11f7267d77e0
BLAKE2b-256 1f7f184509b3b31f0da85a55e6b1b6d5633b24ce6628ec29b22be1296d04605b

See more details on using hashes here.

File details

Details for the file polytropos-2.0.4-py3-none-any.whl.

File metadata

  • Download URL: polytropos-2.0.4-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":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for polytropos-2.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1669cb412731f863cba08ad47ec8ea1086b56f7802d15627c21d827320684b18
MD5 005da87200b438161e68559d600b3786
BLAKE2b-256 121af78140f11b0755f4dd7135871f3cef939c659313b75b79e911b2d30a8225

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page