Repository navigation
Releases: bosd/odoo-lint
Release list
odoo-lint 0.1.0-alpha.8
New since 0.1.0a7:
odl readme(#51): builds a module'sREADME.mdandstatic/description/index.htmlfrom itsreadme/*.mdfragments. The output is the same as the OBS client template's generator: the same comrak 0.54 engine and the same page, byte for byte except for documents with a Mermaid diagram. It does 86 modules in 0.06 s.--checkwrites nothing and exits 1 when something is out of date.- ODOO007
python-field-not-found(#52): field names and paths in Python that don't exist. It looks at@api.depends/onchange/constrains,related=, the inverse field of a One2many, field domains,_order/_rec_nameandmapped(), and follows relational fields to their comodel. When another module of the addons path has the field, the message names it. On Odoo 18 core it found three real defects in Odoo itself. - Go to definition in
odl server(#53): from an XML id, a model or a field to its definition, in XML and Python, including each part of a field path. - U1716 (#49): an onchange
domainOdoo ignores is reported as dead code when the field has a domain of its own (in Python or a view), and as a regression naming the fields when it doesn't. odl check --exit-zero(#56): reports findings but exits 0, for advisory hooks. The pre-commit mirror gets anodoo-lint-advisoryhook with it.- A VS Code extension (#50, #54), published to Open VSX and the Visual Studio Marketplace.
odoo-lint 0.1.0-alpha.7
New since 0.1.0a6: a model of the addons path. odl now knows the models, fields and XML ids of Odoo and all your addons, and checks references between modules before Odoo does at install.
- ODOO004
view-field-not-found(#44): a field in a view that its model doesn't have, as the modulesdependsreaches define it. It follows embedded lists and forms to their comodel. - ODOO005
xml-id-not-found(#46): an XML id (ref=,inherit_id, menus,groups,t-call,%(...)d,ref(), CSV:id,env.ref()) that:- doesn't exist;
- comes from a module outside
depends; - or is loaded later than the record that uses it: in a later file, further down, or only in demo data.
- ODOO006
model-not-found(#46): an_inheritparent, or the model of a record, view or action, that no module independsdefines. - Missing dependencies are named: when another module of the addons path has the field, id or model, the message names it.
- Configuration:
addons-pathin the config (globs such as../oca/*work) or--addons-path.- A module whose dependencies can't all be found isn't checked, so these checks never guess.
- All of Odoo 18 core takes 2 to 3 seconds.
- Field
stringfix (#45): MOD009's fix no longer leavesfields.Char(,)whenstringwas the only argument.
odoo-lint 0.1.0-alpha.6
New since 0.1.0a5:
- Upgrade rules for every version step from 16.0 to 20.0: 93 rules with U codes (U16xx to U20xx), for what breaks or silently stops working on each version (#31, #35, #36, #39, #40).
- About half have a fix. Examples:
<tree>→<list>;attrs/states→ Python expressions, with Odoo 16's own semantics;_sql_constraints→models.Constraint;groups_id→group_ids;t-esc→t-out; typed config parameters. - They were tested against code OCA and Odoo already migrated. For each step, the fixed old branch was compared with the real new one, and the rules were run on the new branch to catch false positives.
odl upgrade-check --target 19.0reports, per module, what is automatic, what to review and what is left by hand.
- About half have a fix. Examples:
upgrade-checkcounts a module's own version for the upgrade rules (#42). A module whose version was bumped to 19.0 before its code was migrated is no longer reported ready.- OCA's remaining module checks (#41): MOD001–MOD009. Unused data files, CSV syntax errors and duplicate ids, unloadable manifests,
README.md, Weblate component length, unused_logger, redundant fieldstring, and header comments (MOD008, opt-in). Parity withoca-checks-odoo-moduleis now 33/33. - Files that do not belong in a module (#41):
- ODOO002 reports packages, archives, executables, database dumps and videos;
- ODOO003 reports files over 1 MiB.
- Both are configurable.
--configreads any pyproject, whatever its file name, and odl says when no config was found (#33).
odoo-lint 0.1.0-alpha.5
New since 0.1.0a4:
- Fill in missing manifest keys from the configuration (#21): a
manifest-defaultstable per module pattern. C8102 and C8119 get a safe fix for a missing required key; C8101 fills in a missing author. Nothing is guessed: without a configured value there is no fix. odl badge(#22): README badges for the share of clean modules and for readiness for an Odoo version.- Trial feedback from a client repository (#25):
- C8101 never changes an existing author, not even with
--unsafe-fixes. - W8163
no-search-allgetsbounded-modelsfor models with few records by design. It's empty by default, as in pylint-odoo.
- C8101 never changes an existing author, not even with
odoo-lint 0.1.0-alpha.4
New since 0.1.0a3:
- XML checks (#19): the XML data files a module's manifest loads are now linted.
- XML001–XML024 reimplement the XML checks of OCA's
oca-checks-odoo-module. All 717 findings on its test repository match by file, line and check. - XML101/XML102 report Bootstrap 4 classes in Odoo 15.0+ modules; XML101 renames them with a fix.
- Version-gated checks follow each module's own manifest version.
- XML001–XML024 reimplement the XML checks of OCA's
odl upgrade-check --target X(#20): what modules need for a newer Odoo version, per version step, split into automatic, to review and by hand. Also available as theupgrade_checkMCP tool.- Release workflow (#18): re-runs of the publish job work without manual cleanup.
uv tool install --prerelease allow odoo-linter # or: pip install --pre odoo-linterodoo-lint 0.1.0-alpha.3
The first alpha with the full pylint-odoo and oca-checks-po rule set, automatic fixes, and integrations for editors, AI agents and git hooks.
uv tool install --prerelease allow odoo-linter # or: pip install --pre odoo-linterHighlights
- Drop-in for pylint-odoo and
oca-checks-po:- Same codes, names and messages as pylint-odoo and oca-checks-po.
- 71/71 checks match on their own test suites.
# pylint: disable=comments keep working.- Rule pages are at https://odoo-lint.readthedocs.io/en/latest/rules/. (#1–#7)
- 250x faster than pylint-odoo: linting OCA/sale-workflow takes 0.10 s instead of 25.8 s, and 0.77 s on a single core. (#12)
- Translation checks that predict Odoo's loader (PO101–PO104): they catch translations Odoo silently drops, references it can't read ("malformed po file"), language files it never loads, and fuzzy entries. (#8)
- Automatic fixes:
odl check --fix,--unsafe-fixesand--diff, for Python, manifests and.po/.potfiles. Examples:self._cr→self.env.cr_()→self.env._()select=→index=- removing superfluous manifest keys
- adding missing
#. module:comments - pretty-formatting PO files the way OCA's check expects
- adding missing msgids to the
.pot(#9)
- AI coding agents:
odl mcpis an MCP server withcheck,fixandruletools.odl hooklints each file right after the agent edits it.- Plugins for Claude Code (
/plugin marketplace add bosd/odoo-lint), DeepSeek Harness and OpenCode. (#10)
- Editors:
odl serveris a language server with diagnostics while you type, quick fixes and "fix all". A Zed extension is included, and the docs cover Neovim, Helix and OpenCode. (#13) - Git hooks:
- pre-commit through bosd/odoo-lint-pre-commit; hk through
hk.pkl. --force-excludeappliesexcludeto the files the hook passes. (#14)
- pre-commit through bosd/odoo-lint-pre-commit; hk through
- CI output formats: GitHub annotations, SARIF (code scanning, reviewdog), GitLab Code Quality and JSON. (#3)
Notes
-
This is an alpha. The CLI, the config format and the rule set can still change before 0.1.0.
-
Configuration lives under
[tool.odoo-lint]inpyproject.toml, or inodoo-lint.toml. See https://odoo-lint.readthedocs.io/en/latest/configuration.html. -
0.1.0-alpha.2 was tagged but never reached PyPI or crates.io (the release workflow failed on immutable releases); this release has the same content.
odoo-lint 0.1.0-alpha.2
The first alpha with the full pylint-odoo and oca-checks-po rule set, automatic fixes, and integrations for editors, AI agents and git hooks.
uv tool install --prerelease allow odoo-linter # or: pip install --pre odoo-linterHighlights
- Drop-in for pylint-odoo and
oca-checks-po:- Same codes, names and messages as pylint-odoo and oca-checks-po.
- 71/71 checks match on their own test suites.
# pylint: disable=comments keep working.- Rule pages are at https://odoo-lint.readthedocs.io/en/latest/rules/. (#1–#7)
- 250x faster than pylint-odoo: linting OCA/sale-workflow takes 0.10 s instead of 25.8 s, and 0.77 s on a single core. (#12)
- Translation checks that predict Odoo's loader (PO101–PO104): they catch translations Odoo silently drops, references it can't read ("malformed po file"), language files it never loads, and fuzzy entries. (#8)
- Automatic fixes:
odl check --fix,--unsafe-fixesand--diff, for Python, manifests and.po/.potfiles. Examples:self._cr→self.env.cr_()→self.env._()select=→index=- removing superfluous manifest keys
- adding missing
#. module:comments - pretty-formatting PO files the way OCA's check expects
- adding missing msgids to the
.pot(#9)
- AI coding agents:
odl mcpis an MCP server withcheck,fixandruletools.odl hooklints each file right after the agent edits it.- Plugins for Claude Code (
/plugin marketplace add bosd/odoo-lint), DeepSeek Harness and OpenCode. (#10)
- Editors:
odl serveris a language server with diagnostics while you type, quick fixes and "fix all". A Zed extension is included, and the docs cover Neovim, Helix and OpenCode. (#13) - Git hooks:
- pre-commit through bosd/odoo-lint-pre-commit; hk through
hk.pkl. --force-excludeappliesexcludeto the files the hook passes. (#14)
- pre-commit through bosd/odoo-lint-pre-commit; hk through
- CI output formats: GitHub annotations, SARIF (code scanning, reviewdog), GitLab Code Quality and JSON. (#3)
Notes
- This is an alpha. The CLI, the config format and the rule set can still change before 0.1.0.
- Configuration lives under
[tool.odoo-lint]inpyproject.toml, or inodoo-lint.toml. See https://odoo-lint.readthedocs.io/en/latest/configuration.html.