OCA / pylint-odoo

Odoo plugin for Pylint
http://www.pylint.org
143 stars 168 forks source link

attribute-string-redundant: false positive on related fields #332

Closed luisg123v closed 3 years ago

luisg123v commented 3 years ago

When a related field is declared, the string attribute is taken by default from the referenced field, so redefining the string is a valid case. For instance:

parent_date = fields.Date(
    related="parent_id.date",
    string="parent date",
)

If a string is not specified, field will be "Date". But if I need the string to be "Parent Date", the lint is triggered.

luisg123v commented 3 years ago

CC @hbto @moylop260 @fernandahf