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
Bug found in form_relation_widgets.js #17051
Comments
Hi @odoo-iventiva, Thank you for your report. Regards, |
@Yenthe666 @odoo-iventiva this is funny, when you look at https://github.com/odoo/odoo/blob/10.0/addons/web/static/src/js/views/form_common.js#L178, |
Actually because of this bug the widget does not work. If I make a model read only, I still see the buttons SAVE and DISCARD in the popup where model data is shown. |
Hi, By this.can_create = this.node.attrs.can_create == "false" ? false : true; |
@Yenthe666 yes |
Okay - will make a PR within the next few days. |
Impacted versions: 10
Steps to reproduce:
We found a bug in file web/static/src/js/views/form_relation_widgets.js (V10). The bug consists in that for a model that is read-only and we want to visualise it in a popup, the buttons SAVE and DISCARD still appear in the popup, which is wrong because those buttons should not appear.
In line 156 of form_relation_widgets.js the statement: readonly: !self.can_write always assigns false because self.can_write is evaluated as a string instead of a boolean. It comes as string instead of boolean Please fix this because it is a terrible bug. Or advice if we are wrong.
Current behaviour: SAVE and DISCARD buttons still appear in form in popup window even if model is set to read only access.
Expected behaviour: SAVE and DISCARD button should not appear. It should only appear the CLOSE button.
Video/Screenshot link (optional):
The text was updated successfully, but these errors were encountered: