Closed moylop260 closed 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.
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:
rgrep "res\.config\.settings" ./*/*/models --include="*.py" |grep "models" | wc -l
You will find ~150 cases
Same for odoo original modules:
rgrep "res\.config\.settings" ./odoo/addons/*/models enterprise/*/models --include="*.py" |grep "models" | wc -l
You will find ~150 cases too
But it is not common for other cases in OCA repositories
rgrep "class.*TransientModel" ./*/*/models --include="*.py" | grep -vi "settings" |wc -l
~65 casesor even for odoo original modules
rgrep "class.*TransientModel" ./odoo/addons/*/models enterprise/*/models --include="*.py" | grep -vi "settings" |wc -l
~25Notice 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
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