Rules
The rules this fork adds on top of Ruff. For the upstream rules, see docs.astral.sh/ruff/rules.
Legend
🧪 The rule is unstable and is in "preview".
⚠️ The rule has been deprecated and will be removed in a future release.
❌ The rule has been removed only the documentation is available.
🛠️ The rule is automatically fixable by the --fix command-line option.
All rules not marked as preview, deprecated or removed are stable.
odoo (OD)
For more, see odoo on PyPI.
For related settings, see odoo.
| Code | Name | Message | Fix/Status |
|---|---|---|---|
| ODC8101 | manifest-required-author | One of the following authors must be present in manifest: '{required}' | Rule has been in preview since 0.16.2.2 |
| ODC8102 | manifest-required-key | Missing required key "{key}" in manifest file | Rule has been in preview since 0.16.2.1 |
| ODC8103 | manifest-deprecated-key | Deprecated key "{key}" in manifest file | Rule has been in preview since 0.16.2.1Automatic fix available |
| ODC8105 | license-allowed | License "{license}" not allowed in manifest file | Rule has been in preview since 0.16.2.2 |
| ODC8106 | manifest-version-format | Wrong Version Format "{version}" in manifest file. Regex to match: "{expected}" | Rule has been in preview since 0.16.2.13 |
| ODC8107 | translation-required | String parameter on "{func}" requires translation. Use {keyword}{translation_method}(...) | Rule has been in preview since 0.16.2.5 |
| ODC8108 | method-compute | Name of compute method should start with "compute" | Rule has been in preview since 0.16.2.2 |
| ODC8109 | method-search | Name of search method should start with "search" | Rule has been in preview since 0.16.2.2 |
| ODC8110 | method-inverse | Name of inverse method should start with "inverse" | Rule has been in preview since 0.16.2.2 |
| ODC8111 | development-status-allowed | Manifest key development_status "{status}" not allowed. Use one of: Alpha, Beta, Mature, Production/Stable. | Rule has been in preview since 0.16.2.2 |
| ODC8112 | missing-readme | Missing ./README.rst file. Template here: {url} | Rule has been in preview since 0.16.2.2 |
| ODC8113 | no-wizard-in-models | No wizard class for model directory. See the complete structure https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#complete-structure | Rule has been in preview since 0.16.2.5 |
| ODC8114 | category-allowed | Category "{category}" not allowed in manifest file | Rule has been in preview since 0.16.2.13 |
| ODC8115 | missing-odoo-file | Missing {path} file | Rule has been in preview since 0.16.2.13 |
| ODC8116 | manifest-superfluous-key | Manifest superfluous key "{key}". It is the same as the default value | Rule has been in preview since 0.16.2.2Automatic fix available |
| ODC8120 | manifest-summary-multiline | Summary in manifest file should be a one-line short description, found newline character | Rule has been in preview since 0.16.2.2Automatic fix available |
| ODC8501 | header-comments | Use of header comments | Rule has been in preview since 0.16.2.2Automatic fix available |
| ODC8502 | pylint-disable-comment | pylint: disable comment should be migrated to # ruff: ignore[{names}] |
Rule has been in preview since 0.16.2.3Automatic fix available |
| ODC9501 | manifest-depends-unsorted | Manifest key "depends" is not sorted alphabetically | Rule has been in preview since 0.16.3.33Automatic fix available |
| ODE8101 | manifest-author-string | The author key in the manifest file must be a string (with comma separated values) | Rule has been in preview since 0.16.2.2Automatic fix available |
| ODE8102 | invalid-commit | Use of cr.commit() directly | Rule has been in preview since 0.16.2.2 |
| ODE8103 | sql-injection | SQL injection risk. Use parameters if you can. - More info https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#no-sql-injection | Rule has been in preview since 0.16.2.5 |
| ODE8104 | manifest-maintainers-list | The maintainers key in the manifest file must be a list of strings | Rule has been in preview since 0.16.2.2Automatic fix available |
| ODE8106 | external-request-timeout | Use of external request method {method} without timeout. It could wait for a long time |
Rule has been in preview since 0.16.2.5Automatic fix available |
| ODE8130 | test-folder-imported | Test folder imported in module | Rule has been in preview since 0.16.2.2Automatic fix available |
| ODE8135 | no-write-in-compute | Compute method calling write. Use update instead. |
Rule has been in preview since 0.16.2.2 |
| ODE8140 | no-raise-unlink | No exceptions should be raised inside unlink() functions | Rule has been in preview since 0.16.2.2 |
| ODE8145 | manifest-behind-migrations | Manifest version ({version}) is lower than migration scripts ({migration}) | Rule has been in preview since 0.16.2.8 |
| ODE8146 | deprecated-name-get | 'name_get' is deprecated. Use '_compute_display_name' instead | Rule has been in preview since 0.16.2.2 |
| ODE8147 | inheritable-method-string | Use string method name "{name}" to preserve inheritability |
Rule has been in preview since 0.16.2.2Automatic fix available |
| ODE8148 | inheritable-method-lambda | Use {argument}=lambda self: self.{name}() to preserve inheritability |
Rule has been in preview since 0.16.2.2Automatic fix available |
| ODE8149 | deprecated-inselect-operator | The domain operator '{operator}' is deprecated in Odoo 18.0+. Use 'in' SQL or 'not in' SQL instead | Rule has been in preview since 0.16.2.2 |
| ODE8151 | translation-injection | Do not use str.format on translation methods. Use placeholders instead | Rule has been in preview since 0.16.2.2 |
| ODE8300 | translation-unsupported-format | Unsupported odoo._ format character '{unsupported_char}' ({:#04x}) at index {index} | Rule has been in preview since 0.16.2.9 |
| ODE8301 | translation-format-truncated | odoo._ format string ends in middle of conversion specifier | Rule has been in preview since 0.16.2.9 |
| ODE8305 | translation-too-many-args | Too many arguments for odoo._ format string | Rule has been in preview since 0.16.2.9 |
| ODE8306 | translation-too-few-args | Not enough arguments for odoo._ format string | Rule has been in preview since 0.16.2.9 |
| ODE9501 | deprecated-sql-constraints | Model attribute _sql_constraints is no longer supported since Odoo 19.0, define models.Constraint attributes on the model instead |
Rule has been in preview since 0.16.3.33Automatic fix available |
| ODE9502 | invalid-odoo-method-call | {name} has no parameter {keyword} in Odoo {version} |
Rule has been in preview since 0.16.3.34 |
| ODE9503 | removed-odoo-method-call | {name} was removed from the Odoo ORM in {removed_in} |
Rule has been in preview since 0.16.3.34 |
| ODF8101 | resource-not-exist | File "{key}": "{resource}" not found | Rule has been in preview since 0.16.2.5 |
| ODR8101 | odoo-exception-warning | odoo.exceptions.Warning is a deprecated alias to odoo.exceptions.UserError, use from odoo.exceptions import UserError |
Rule has been in preview since 0.16.2.2Automatic fix available |
| ODR8180 | consider-merging-classes-inherited | Consider merging classes inherited to "{model}" from {locations}. | Rule has been in preview since 0.16.2.11 |
| ODR8181 | invalid-email | Invalid email "{email}" | Rule has been in preview since 0.16.2.2 |
| ODW8103 | translation-field | Translation method _("string") in fields is not necessary | Rule has been in preview since 0.16.2.2Automatic fix available |
| ODW8105 | attribute-deprecated | attribute "{attribute}" deprecated | Rule has been in preview since 0.16.2.2 |
| ODW8106 | method-required-super | Missing super call in "{name}" method |
Rule has been in preview since 0.16.2.1 |
| ODW8107 | prohibited-method-override | Prohibited override of "{name}" method | Rule has been in preview since 0.16.2.8 |
| ODW8110 | missing-return | Missing return (super is used) in method {name} |
Rule has been in preview since 0.16.2.2Automatic fix available |
| ODW8111 | renamed-field-parameter | Field parameter "{old}" is no longer supported. Use "{new}" instead. | Rule has been in preview since 0.16.2.2Automatic fix available |
| ODW8113 | attribute-string-redundant | The string attribute is redundant and should be removed |
Rule has been in preview since 0.16.2.1Automatic fix available |
| ODW8114 | website-manifest-key-not-valid-uri | Website "{website}" in manifest key is not a valid URI | Rule has been in preview since 0.16.2.2 |
| ODW8115 | translation-contains-variable | Translatable term contains variables. Interpolate outside the translation call | Rule has been in preview since 0.16.2.2 |
| ODW8120 | translation-positional-used | Translation method is using positional string printf formatting with multiple arguments. Use named placeholders instead | Rule has been in preview since 0.16.2.2Automatic fix available |
| ODW8121 | context-overridden | Context overridden using dict. Better using kwargs with_context(**{arg}) or with_context(key=value) |
Rule has been in preview since 0.16.2.2 |
| ODW8125 | manifest-data-duplicated | The file "{file}" is duplicated in manifest key "{key}" | Rule has been in preview since 0.16.2.5Automatic fix available |
| ODW8138 | except-pass | except block with only a pass statement; consider logging the exception |
Rule has been deprecated since 0.16.3.22 |
| ODW8150 | odoo-addons-relative-import | Same Odoo module absolute import. You should use relative import with "." instead of "odoo.addons.{module}" | Rule has been in preview since 0.16.2.2Automatic fix available |
| ODW8155 | bad-builtin-groupby | Used builtin function itertools.groupby. Prefer odoo.tools.groupby instead. |
Rule has been in preview since 0.16.2.2Automatic fix available |
| ODW8160 | deprecated-odoo-model-method | {name} has been deprecated by Odoo. Override {replacement} instead. |
Rule has been in preview since 0.16.2.2 |
| ODW8161 | prefer-env-translation | Better using self.env._ | Rule has been in preview since 0.16.2.2Automatic fix available |
| ODW8162 | manifest-external-assets | Asset {url} should be distributed with module's source code | Rule has been in preview since 0.16.2.2 |
| ODW8163 | no-search-all | Using an empty domain {method}([]) without a limit will load all records of "{model}", may impact performance. |
Rule has been in preview since 0.16.2.2 |
| ODW8164 | super-method-mismatch | super().{called} mismatch but defined method is {defined} |
Rule has been in preview since 0.16.2.2 |
| ODW8165 | prefer-env-attribute | Use "{receiver}.env.{replacement}" instead of "{receiver}.{deprecated}" (deprecated since 19.0) | Rule has been in preview since 0.16.2.14Automatic fix available |
| ODW8202 | use-vim-comment | Use of vim comment | Rule has been in preview since 0.16.2.1Automatic fix available |
| ODW8301 | translation-not-lazy | Use lazy % formatting in odoo._ functions | Rule has been in preview since 0.16.2.9Automatic fix available |
| ODW8302 | translation-format-interpolation | Use lazy % formatting in odoo._ functions instead of str.format | Rule has been in preview since 0.16.2.9Automatic fix available |
| ODW8303 | translation-fstring-interpolation | Use lazy % formatting in odoo._ functions instead of an f-string | Rule has been in preview since 0.16.2.9Automatic fix available |
| ODW8501 | unused-logger | Unused _logger |
Rule has been in preview since 0.16.2.1Automatic fix available |
| ODW8502 | deprecated-odoo-method-call | {name} was removed in Odoo {removed} (deprecated since {since}). {replacement} |
Rule has been in preview since 0.16.2.14Automatic fix available |
| ODW9501 | m2m-relation-is-label | {relation} is the relation table of this Many2many, not its label; pass the label as string="{relation}" |
Rule has been in preview since 0.16.3.25 |
| ODW9502 | deprecated-osv-expression | odoo.osv.expression.{name} is deprecated since Odoo 19.0. {replacement} |
Rule has been in preview since 0.16.3.33Automatic fix available |
| ODW9503 | duplicate-field-declaration | Field {name} is declared multiple times; only the declaration on {row} takes effect |
Rule has been in preview since 0.16.3.33 |
odoo-app (OAPP)
For more, see odoo-app on GitHub.
| Code | Name | Message | Fix/Status |
|---|---|---|---|
| OAPP001 | category-allowed-app | Category "{category}" not allowed in manifest file for modules with price | Rule has been in preview since 0.16.2.10 |
| OAPP002 | missing-odoo-file-app | Missing {path} file for modules with price | Rule has been in preview since 0.16.2.10 |
| OAPP003 | manifest-required-key-app | Missing required key "{key}" in manifest file for modules with price | Rule has been in preview since 0.16.2.10 |