-
-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ADD] Add warning for related fields with store=True #98
Conversation
This PR adds a warning for related fields with `store=True`, as it is no longer necessary to store related fields for grouping, aggregating, or sorting in Odoo 18. The warning encourages developers to remove `store=True` unless strictly required, optimizing performance and reducing disk space usage. More details can be found in the related Odoo PR: odoo/odoo#127353
I think this should be in pylint-odoo cc @moylop260 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
I don't get it. It can be totally valid to write a store=True related field, AFAIK. |
If not needed (talking about performance reasons), why do it? |
I missed something. If I understand correctly : store=True (for related fields) :
For me It can still be valid. |
In theory, you don't get performance penalty when not storing for that. That's why there's a warning. |
I don't see new warning in the PR : odoo/odoo#127353 If you talk about the warning introduced by the current PR, #98, it is just a warning. maybe something should be done, but related="xx.xxx", store="True" is still valid. I can not figure out how a non stored field can generate exactly the same performance as a stored field, as it is introducing an extra join in the SQL. Let me know if I missed something. |
OK, then let's not put the warning at all if there are drawbacks removing the store. |
Well, the documentation in https://github.com/OCA/odoo-module-migrator says :
So for me, it's ok to introduce this warning or not. (matter of taste). |
This is a good suggestion for odoo-module-migrator. I don't think it adds much to pylint-odoo. cc @pedrobaeza |
Right, I understood that it was somehow mandatory with no performance penalty |
So? we proceed with merging? |
This PR adds a warning for related fields with
store=True
, as it is no longer necessary to store related fields for grouping, aggregating, or sorting in Odoo 18. The warning encourages developers to removestore=True
unless strictly required, optimizing performance and reducing disk space usage.More details can be found in the related Odoo PR: odoo/odoo#127353