OCA / pylint-odoo

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

[RFQ] New Check: Creation of records on xml must have an specific order. #273

Closed keylor2906 closed 3 years ago

keylor2906 commented 4 years ago

We should make a convention rule about ordering creation of records, for example in a case of views, actions and menuitems. Maybe have all views, then all actions and then all menuitems or each view having beneath their respective action and menuitem.

I think this kind of conventions could help us maintain the code.

moylop260 commented 3 years ago

I think it is a good idea

Odoo is validating the order with the xmlid created

I mean, You can not use a <menu action="xmlid" if xmlid is not created before So it forces to define it at bottom

But maybe a tool similar to isort for odoo_xml_sort instead of checks could be better in order to auto-fix all them since that the check could raises a lot of checks and the diff to fix it could bigger and not easy to control the order in the field editing

Since that pylint-odoo does not support auto-fixes I will close it