OCA / pylint-odoo

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

[ADD] no-wizard-in-models: Add new check for avoid adding wizards class in models directory #437

Closed moylop260 closed 1 year ago

moylop260 commented 1 year ago

See the structure of modules where wizard models should be in wizards directory instead of models

See the complete structure https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#complete-structure | C8113

voronind commented 1 year ago

Guidelines doesn't require to keep Transient models in wizards directory. Why there is exception for res.config.settings? It's wizard model.

moylop260 commented 1 year ago

Guidelines doesn't require to keep Transient models in wizards directory.

Yes, it is:

Why there is exception for res.config.settings? It's wizard model.

Historical reasons

Clone all the OCA repositories and run the following script:

You will find ~150 cases

Same for odoo original modules:

You will find ~150 cases too

But it is not common for other cases in OCA repositories

or even for odoo original modules

Notice this lint is not enabled in OCA

We could say it is a beta check that could be improved or changed even disabled from pylint.cfg