Skip to main content
OLS01xxx diagnostics cover Python-level structural issues: parse failures, invalid base classes, malformed super() calls, and incorrect function argument usage.
Default severity: ErrorMessage: Unable to parse file. Ruff_python_parser was unable to parse the file content.OdooLS uses the Ruff Python parser to build a syntax tree for each file. This error fires when the parser fails entirely, meaning the file contains syntax that cannot be parsed.Fix: Check the error message appended to the diagnostic for the specific parser error from Ruff. Common causes are unclosed brackets, invalid indentation, or Python 2 syntax in a Python 3 file.
Default severity: WarningMessage: {0} not foundThe symbol used as a base class in a class definition cannot be resolved. OdooLS cannot find the name in any reachable scope.
class MyModel(UnknownBase):  # OLS01001: UnknownBase not found
    pass
Fix: Ensure the base class is imported and that its module is reachable from the configured addon paths and Python environment.
Default severity: WarningMessage: {0} not foundThe symbol used as a base class resolves to something that is not a class (for example, a function, variable, or module).Fix: Verify that the symbol you are inheriting from is indeed a class definition.
Default severity: WarningMessage: Multiple definition found for base classOdooLS found more than one possible definition for the base class and cannot determine which one to use.Fix: This warning may resolve automatically as OdooLS improves its resolution logic. In the meantime, avoid ambiguous re-exports of class names across modules.
Default severity: ErrorMessage: Non-static method should have at least one parameterA method defined inside a class body is missing its first positional parameter (conventionally self or cls for class methods).
class MyModel(models.Model):
    def my_method():  # OLS01004: missing self
        pass
Fix: Add self (or cls for @classmethod) as the first parameter.
Default severity: ErrorMessage: First Argument to super must be a classWhen calling super() with explicit arguments, the first argument must be a class, not an instance, string, or other value.
super("MyModel", self)  # OLS01005: string is not a class
Fix: Pass the class itself as the first argument: super(MyModel, self).
Default severity: ErrorMessage: Super calls outside a class scope must have at least one argumentsuper() called with no arguments is only valid inside a class body. Outside a class, you must provide at least the class as the first argument.Fix: Move the super() call into a class method, or provide explicit arguments.
Default severity: ErrorMessage: {0} takes {1} positional arguments but {2} was givenA function or method was called with more positional arguments than its signature accepts.
def compute_name(self, extra):  # takes 2 (self + extra)
    pass

record.compute_name(1, 2, 3)  # OLS01007: too many arguments
Fix: Match the number of positional arguments to the function signature, or adjust the signature.
Default severity: ErrorMessage: {0} got an unexpected keyword argument '{1}'A function was called with a keyword argument that does not appear in its parameter list and it does not accept **kwargs.
def create(self, vals):  # no 'context' parameter
    pass

self.create(vals={}, context={})  # OLS01008: unexpected keyword argument 'context'
Fix: Remove the unexpected keyword argument, or add the parameter to the function signature.
Default severity: WarningMessage: Arguments are not valid for all function or method definitionsWhen a name resolves to multiple possible function definitions (for example, through multiple inheritance or conditional imports), the arguments provided are not valid for at least one of those definitions.Fix: Review the possible definitions of the called symbol and ensure argument usage is compatible with all of them, or disambiguate the call site.
Default severity: ErrorMessage: Missing keyword-only argument(s): {0}A function was called without providing required keyword-only arguments (arguments defined after * or *args in the signature).
def search(self, domain, *, limit):  # limit is keyword-only
    pass

self.search([])  # OLS01010: Missing keyword-only argument(s): limit
Fix: Add the missing keyword argument(s) to the call.

Build docs developers (and LLMs) love