Skip to content
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

[FW][FIX] account/saas~16.3: avoid update of unchanged code prefix #165154

Conversation

fw-bot
Copy link
Contributor

@fw-bot fw-bot commented May 10, 2024

Updating the code field of accounts can trigger a lot of recomputes. Especially during upgrades, this can lead to MemoryError. For this reason, in #125320, it was decided that only tags should be updated on account.account when updating a CoA. But, it can happen that a superfluous code update sneeks in through
ResCompany.reflect_code_prefix_change(), even though the old code and the new one are the same. Avoid this unnecessary update by returning early from the function when old and new codes are the same.

Forward-Port-Of: #165070

Updating the code field of accounts can trigger a lot of recomputes. Especially
during upgrades, this can lead to MemoryError. For this reason, in
odoo#125320, it was decided that only tags should
be updated on account.account when updating a CoA. But, it can happen that a
superfluous code update sneeks in through
`ResCompany.reflect_code_prefix_change()`, even though the old code and the new
one are the same. Avoid this unnecessary update by returning early from the
function when old and new code are the same.

X-original-commit: 6778137
@robodoo
Copy link
Contributor

robodoo commented May 10, 2024

@robodoo robodoo added the forwardport This PR was created by @fw-bot label May 10, 2024
@cawo-odoo
Copy link
Contributor

@fw-bot r+

@C3POdoo C3POdoo added the RD research & development, internal work label May 10, 2024
robodoo pushed a commit that referenced this pull request May 10, 2024
Updating the code field of accounts can trigger a lot of recomputes. Especially
during upgrades, this can lead to MemoryError. For this reason, in
#125320, it was decided that only tags should
be updated on account.account when updating a CoA. But, it can happen that a
superfluous code update sneeks in through
`ResCompany.reflect_code_prefix_change()`, even though the old code and the new
one are the same. Avoid this unnecessary update by returning early from the
function when old and new code are the same.

closes #165154

X-original-commit: 6778137
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Carsten Wolff (cawo) <cawo@odoo.com>
@robodoo robodoo closed this May 11, 2024
@robodoo robodoo added the 17.3 label May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
17.3 forwardport This PR was created by @fw-bot RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants