Skip to content

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 (ODOO)

For more, see odoo on PyPI.

For related settings, see odoo.

Code Name Message Fix/Status
ODOO001 manifest-required-key Missing required key "{key}" in manifest file
Rule has been in preview since 0.16.2.1
ODOO002 manifest-deprecated-key Deprecated key "{key}" in manifest file
Rule has been in preview since 0.16.2.1Automatic fix available
ODOO003 use-vim-comment Use of vim comment
Rule has been in preview since 0.16.2.1Automatic fix available
ODOO004 except-pass except block with only a pass statement; consider logging the exception
Rule has been in preview since 0.16.2.1
ODOO005 method-required-super Missing super call in "{name}" method
Rule has been in preview since 0.16.2.1
ODOO006 unused-logger Unused _logger
Rule has been in preview since 0.16.2.1Automatic fix available
ODOO007 attribute-string-redundant The string attribute is redundant and should be removed
Rule has been in preview since 0.16.2.1Automatic fix available
ODOO008 manifest-required-author One of the following authors must be present in manifest: '{required}'
Rule has been in preview since 0.16.2.2
ODOO009 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.2
ODOO010 license-allowed License "{license}" not allowed in manifest file
Rule has been in preview since 0.16.2.2
ODOO011 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.2
ODOO012 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
ODOO013 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
ODOO014 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
ODOO015 invalid-email Invalid email "{email}"
Rule has been in preview since 0.16.2.2
ODOO016 missing-readme Missing ./README.rst file
Rule has been in preview since 0.16.2.2
ODOO017 invalid-commit Use of cr.commit() directly
Rule has been in preview since 0.16.2.2
ODOO018 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
ODOO019 bad-builtin-groupby Used builtin function itertools.groupby. Prefer odoo.tools.groupby instead.
Rule has been in preview since 0.16.2.2
ODOO020 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.2
ODOO021 attribute-deprecated attribute "{attribute}" deprecated
Rule has been in preview since 0.16.2.2
ODOO022 missing-return Missing return (super is used) in method {name}
Rule has been in preview since 0.16.2.2
ODOO023 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.2
ODOO024 prefer-env-translation Better using self.env._
Rule has been in preview since 0.16.2.2Automatic fix available
ODOO025 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
ODOO026 header-comments Use of header comments
Rule has been in preview since 0.16.2.2Automatic fix available
ODOO027 method-compute Name of compute method should start with "compute"
Rule has been in preview since 0.16.2.2
ODOO028 method-search Name of search method should start with "search"
Rule has been in preview since 0.16.2.2
ODOO029 method-inverse Name of inverse method should start with "inverse"
Rule has been in preview since 0.16.2.2
ODOO030 renamed-field-parameter Field parameter "{old}" is no longer supported. Use "{new}" instead.
Rule has been in preview since 0.16.2.2
ODOO031 translation-field Translation method _("string") in fields is not necessary
Rule has been in preview since 0.16.2.2
ODOO032 inheritable-method-string Use string method name "{name}" to preserve inheritability
Rule has been in preview since 0.16.2.2
ODOO033 inheritable-method-lambda Use {argument}=lambda self: self.{name}() to preserve inheritability
Rule has been in preview since 0.16.2.2
ODOO034 deprecated-name-get 'name_get' is deprecated. Use '_compute_display_name' instead
Rule has been in preview since 0.16.2.2
ODOO036 super-method-mismatch super().{called} mismatch but defined method is {defined}
Rule has been in preview since 0.16.2.2
ODOO037 deprecated-odoo-model-method {name} has been deprecated by Odoo. Please look for alternatives.
Rule has been in preview since 0.16.2.2
ODOO038 no-search-all Using an empty domain {method}([]) without a limit will load all records, may impact performance.
Rule has been in preview since 0.16.2.2
ODOO039 no-raise-unlink No exceptions should be raised inside unlink() functions
Rule has been in preview since 0.16.2.2
ODOO040 no-write-in-compute Compute method calling write. Use update instead.
Rule has been in preview since 0.16.2.2
ODOO041 translation-contains-variable Translatable term contains variables. Interpolate outside the translation call
Rule has been in preview since 0.16.2.2
ODOO042 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
ODOO043 translation-injection Do not use str.format on translation methods. Use placeholders instead
Rule has been in preview since 0.16.2.2
ODOO044 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
ODOO045 test-folder-imported Test folder imported in module
Rule has been in preview since 0.16.2.2
ODOO046 manifest-external-assets Asset {url} should be distributed with module's source code
Rule has been in preview since 0.16.2.2
ODOO047 pylint-disable-comment pylint: disable comment should be migrated to # noqa: {codes}
Rule has been in preview since 0.16.2.3Automatic fix available
ODOO048 manifest-data-duplicated The file "{file}" is duplicated in manifest key "{key}"
Rule has been in preview since 0.16.2.5Automatic fix available
ODOO049 translation-required String parameter on "{func}" requires translation. Use {keyword}{translation_method}(...)
Rule has been in preview since 0.16.2.5
ODOO050 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
ODOO051 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.5
ODOO052 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
ODOO053 resource-not-exist File "{key}": "{resource}" not found
Rule has been in preview since 0.16.2.5
ODOO054 manifest-behind-migrations Manifest version ({version}) is lower than migration scripts ({migration})
Rule has been in preview since 0.16.2.8
ODOO055 prohibited-method-override Prohibited override of "{name}" method
Rule has been in preview since 0.16.2.8
ODOO056 translation-format-interpolation Use lazy % formatting in odoo._ functions instead of str.format
Rule has been in preview since 0.16.2.9
ODOO057 translation-format-truncated odoo._ format string ends in middle of conversion specifier
Rule has been in preview since 0.16.2.9
ODOO058 translation-fstring-interpolation Use lazy % formatting in odoo._ functions instead of an f-string
Rule has been in preview since 0.16.2.9
ODOO059 translation-not-lazy Use lazy % formatting in odoo._ functions
Rule has been in preview since 0.16.2.9Automatic fix available
ODOO060 translation-too-few-args Not enough arguments for odoo._ format string
Rule has been in preview since 0.16.2.9
ODOO061 translation-too-many-args Too many arguments for odoo._ format string
Rule has been in preview since 0.16.2.9
ODOO062 translation-unsupported-format Unsupported odoo._ format character '{unsupported_char}' ({:#04x}) at index {index}
Rule has been in preview since 0.16.2.9
ODOO063 consider-merging-classes-inherited Consider merging classes inherited to "{model}" from {locations}.
Rule has been in preview since 0.16.2.11
ODOO064 manifest-version-format Wrong Version Format "{version}" in manifest file. Regex to match: "{expected}"
Rule has been in preview since 0.16.2.13
ODOO065 category-allowed Category "{category}" not allowed in manifest file
Rule has been in preview since 0.16.2.13
ODOO066 missing-odoo-file Missing {path} file
Rule has been in preview since 0.16.2.13
ODOO067 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
ODOO068 deprecated-odoo-method-call {name} is deprecated since Odoo {since}. {replacement}
Rule has been in preview since 0.16.2.14Automatic fix available

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