-
-
Notifications
You must be signed in to change notification settings - Fork 2k
[18.0][FIX] web_m2x_options: prevent crash on Many2OneReferenceField #3191
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
Conversation
cc/ @glitchov , |
4cb2dc9
to
868f851
Compare
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.
I can't work on this right now. if someone else is available to take it over, I'd appreciate it |
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
LGTM |
@sbejaoui Please add the roadmap entry so this can be merged quickly, given the impact of the bug. |
Many2OneReferenceField inherits the props definition from Many2OneField but does not inherit the prototype methods added via patch() on many2OneField, including m2o_options_props() without this patch, calling extractProps() on Many2OneReferenceField leads to "this.m2o_options_props is not a function" errors because this method is undefined this fix adds a no-op m2o_options_props() implementation on Many2OneReferenceField to ensure compatibility and safely bypass the m2o_options_props logic since it's not relevant for reference fields
868f851
to
5d2726c
Compare
done |
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.
@carlos-lopez-tecnativa can you live with this for now?
This PR has the |
/ocabot merge patch |
Hey, thanks for contributing! Proceeding to merge this for you. |
Congratulations, your PR was merged at 7bd5d32. Thanks a lot for contributing to OCA. ❤️ |
Many2OneReferenceField
inherits the props definition fromMany2OneField
but does not inherit the prototype methods added viapatch
onmany2OneField
, includingm2o_options_props
without this patch, calling
extractProps
onMany2OneReferenceField
leads to"this.m2o_options_props is not a function"
errors because this method is undefinedthis fix adds a no-op
m2o_options_props
implementation onMany2OneReferenceField
to ensure compatibility and safely bypass them2o_options_props
logic since it's not relevant for reference fieldsto reproduce this bug, open any view with many2one reference field, example attachment form view