-
Notifications
You must be signed in to change notification settings - Fork 23.2k
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
[FIX] base: do not overwrite context when upgrading #71802
[FIX] base: do not overwrite context when upgrading #71802
Conversation
please @rco-odoo could you check? we need this and it's very simple |
Why? Can you please explain the problem you are trying to solve? |
Well, we want to pas some context info when calling the _process_end method, but this method is overwriting the context :S |
This is what you want to do, not why you want to do it. Besides, |
As to why we want to pass flags in context in this method, it's to be able to do nice hooks instead of superugly hooks. It happens that when doing _process_end(), it may try to delete some model data and we are in a project where we don't want that deletion somehow in some cases. |
I really don't get it. As I wrote before, |
Well, let's go with a broader explanation: We in OpenUpgrade (v13) project (a fork which contains some core patches to avoid deleting obsolete data) added this FIX to avoid an error. But in OpenUpgrade (v14) project we decided to avoid doing a fork, and we proceed with clean monkeypatches approach. That fix was forward ported here (in a clean but a bit convoluted way), because we don't want to do ugly monkeypatches with verbatim copies of odoo methods. But we found that this patch only fixes the uninstall case, but not the upgrading case. We detected the upgrading case error in base_automation migration, that when doing Well, I know you have your migration process and maybe don't like our free community approach, that's why I didn't want to say it at the beginning. I hope you understand all I said, and feel free to ask anything. |
Ouch! I understand how the monkeypatch works, but it looks so fragile: any fix in the original code can make it break. We solve such cases in a different way. Our migration framework runs scripts that adapts data in plain SQL most of the time. This avoids the problem of the missing model, and is usually much more efficient. If the default process fails, we adapt the scripts to solve the problem ahead of the failure. I will ask for other opinions before making a decision. |
@rco-odoo Yeah. I hope we receive your green-light soon. |
@rco-odoo any chance this minor patch can be accepted? 🙏 I mean, I don't see why one method has to extend and the other has to force. Let's make both extend to overall "harmonize" it? I can edit the commit message if you prefer and put something more suitable. |
Just allow to pass flags to the context of _process_end method.
e6b7e0c
to
adc9679
Compare
Dear @MiquelRForgeFlow, Thank you for your contribution but the version 14.0 is no longer supported. We apology if we could not look at your request in time. This is an automated message. |
Just allow to pass flags to the context of
_process_end
method.(the same is done in https://github.com/odoo/odoo/blob/14.0/odoo/addons/base/models/ir_model.py#L2087)
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr