attribute-string-redundant (ODOO007)
Preview (since 0.16.2.1) · 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 a string= argument on an Odoo field definition that's redundant with the
field's own variable name.
Why is this bad?
Odoo infers a human-readable label from the field's variable name (converting
snake_case to Title Case), so a string argument that matches that inferred label
is dead weight.
Example
class MyModel(models.Model):
_inherit = "my.model"
partner_id = fields.Many2one("res.partner", string="Partner")
Use instead: