Skip to content

renamed-field-parameter (ODW8111)

Preview (since 0.16.2.2) · Related issues · View source

Derived from the odoo linter.

Fix is sometimes available.

This rule is unstable and in preview. The --preview flag is required for use.

What it does

Checks for field arguments that were renamed in newer Odoo versions (digits_computedigits, selectindex).

Why is this bad?

The old parameter names are silently ignored by the current ORM, so the intended behavior (precision, indexing) is lost.

Example

amount = fields.Float(digits_compute=get_precision("Account"))

Use instead:

amount = fields.Float(digits=get_precision("Account"))

Fix safety

This rule's fix is marked as unsafe: the old parameter was silently ignored by the ORM, so renaming it enables behavior (precision, indexing) that the running code did not have. No fix is offered when the call already passes the new parameter, since renaming would produce a duplicate keyword argument.

Options

Each entry is written old:new.