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
[IMP] website: choose between radio or dropdown in select fields #138944
[IMP] website: choose between radio or dropdown in select fields #138944
Conversation
539e4e4
to
2a86f65
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.
Here is a first review.
In the commit message, you can put the website
on the first line without using the *
👍
@@ -289,13 +289,18 @@ | |||
<t t-call="website.form_field"> | |||
<select class="form-select s_website_form_input" t-att-name="field.name" t-att-required="field.required || field.modelRequired || None" t-att-id="field.id" style="display: none"> | |||
<t t-foreach="field.records" t-as="record" t-key="record_index"> | |||
<option t-esc="record.display_name" t-att-value="record.id" t-att-selected="record.selected and 'selected' or None"/> | |||
<option t-attf-selected="#{record.selected and 'selected' or None}" t-esc="record.display_name" t-att-value="record.id"/> |
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.
Why this change ? And why do you change the order of attributes ?
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.
Following the changes introduced in 6303a3e, there is a bug affecting the behavior of t-att-selected, possibly introduced in the subsequent commit: 3632519. I've created a task (id:3767819). A work around to avoid waiting the forward-port in master, is to use t-attf instead. I could remove this change as soon as the bug is fixed.
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.
@Guillaume-gdi I took inspiration from the commit b42e9cc by @rdeodoo to address this issue, which will be resolved in the aforementioned task.
https://github.com/odoo/odoo/pull/138944/files#diff-e84353750393781d43d4a4bb1debe41db124f3b0ef9301e516f622695905d4b4R292
ad9d5fa
to
bc96432
Compare
bc96432
to
c42084c
Compare
783dc05
to
83a0023
Compare
83a0023
to
4d690c0
Compare
4d690c0
to
d01e21d
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.
Here are a few comments:
d01e21d
to
deabc84
Compare
044a994
to
681e32e
Compare
This task addresses the limitation where users do not have the option to choose between a select and radio button when dealing with existing fields. The goal is to facilitate a more informed choice between the two based on the number of available options. A new "Selection Type" option is added, allowing users to choose between Dropdown List and Radio for fields with a moderate number of options. The option fields are removed from the preview area, considering that the options are already displayed in the right panel. task-2232291
681e32e
to
11d1832
Compare
@robodoo r+ |
This task addresses the limitation where users do not have the option to choose between a select and radio button when dealing with existing fields. The goal is to facilitate a more informed choice between the two based on the number of available options. A new "Selection Type" option is added, allowing users to choose between Dropdown List and Radio for fields with a moderate number of options. The option fields are removed from the preview area, considering that the options are already displayed in the right panel. task-2232291 closes #138944 Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
This task addresses the limitation where users do not have the option to choose between a select and radio button when dealing with existing fields. The goal is to facilitate a more informed choice between the two based on the number of available options. A new "Selection Type" option is added, allowing users to choose between Dropdown List and Radio for fields with a moderate number of options. The option fields are removed from the preview area, considering that the options are already displayed in the right panel. task-2232291 closes odoo#138944 Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
This task addresses the limitation where users do not have the option
to choose between a select and radio button when dealing with existing
fields. The goal is to facilitate a more informed choice between the
two based on the number of available options.
A new "Selection Type" option is added, allowing users to choose between
Dropdown List and Radio for fields with a moderate number of options.
The option fields are removed from the preview area, considering that
the options are already displayed in the right panel.
task-2232291