-
-
Notifications
You must be signed in to change notification settings - Fork 161
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
[12.0][FIX] event_registration_multi_qty: Force quantity despite default #220
[12.0][FIX] event_registration_multi_qty: Force quantity despite default #220
Conversation
After odoo/odoo@a4d50b4, the passed value is not taken into account when a default value is set on the field. This adds the option of passing the desired value through the context and force that update.
e679684
to
1248db7
Compare
@pedrobaeza @victoralmau can you review this, please? |
@chienandalu good for you? |
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.
One thing before merging: is this field in core? If so, please add tests. If not, you should put an explanation as comment.
No, the field is added in this module. Is the current comment enough to explain it? |
Why then you check about |
It's not a record, but a dictionary. Look: https://github.com/odoo/odoo/blob/a4d50b468c8f37155048e2c7bb0c816f45d27a95/addons/event/models/event.py#L439-L442 @joao-p-marques Maybe a link to the original method would ease the understanding of this change |
OK, the variable name is very bad (it should be |
Yes, but it comes from core 🤷♂️
Well, you said above to add tests if it the field came from core, which it does not. Do you still think it is worth it? |
Yes, I didn't express myself correctly. I mean that it comes with the dependency chain, not in extra module and this is a hack for avoiding a glue module. If this problem has arisen, a regression test would avoid to appear again in the future. Is it very complicated? |
Ok. Well, I guess I can add a simple test that calls the function and asserts the value is actually changed |
I'm afraid that doesn't serve. Tests should check real flows, not direct function calls. If not, in an upper version or future code revision, implementation may change, but the test will be correct. |
Well, then maybe @chienandalu can shed some light into what an appropriate test would be. Quite honestly, I didn't find this issue in UI, but in integration tests with another module, so that was the case I tested... |
The problem here is that although |
Ok, let's assume this and go: /ocabot merge patch |
This PR looks fantastic, let's merge it! |
Congratulations, your PR was merged at 7448692. Thanks a lot for contributing to OCA. ❤️ |
After odoo/odoo@a4d50b4, the passed value is not taken into account when a default value is set on the field.
This forces the update to the quantity.
cc @Tecnativa @chienandalu