Skip to content

Commit

Permalink
[FIX] website: restore default selected value for form selections type
Browse files Browse the repository at this point in the history
Since the PR [1] changed the rendering engine of qweb, the default
"selected" value set on selects field on the form snippet were lost once
the page is saved.

This commit builds upon the changes made in [this commit] by reinstating
the default "selected" value.

Steps to replicate:

- Go to Website -> Edit.
- Drop a Form snippet onto the page.
- Click on the 'Company' field.
- In Field > Type, opt for "Selection".
- Choose option 3 from the options list to establish it as the default.
- Save the modifications.

Issue: The expected default value for the selection field is not
retained after saving.

[1]: #130467
[this commit]: b42e9cc

task-3767819

closes #155838

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
  • Loading branch information
SergeBayet committed Feb 29, 2024
1 parent 5ceda30 commit dd50481
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addons/website/static/src/xml/website_form_editor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@
<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-esc="record.display_name" t-att-value="record.id" t-att="{selected: record.selected and 'selected' or None}"/>
</t>
</select>
<div id="editable_select" class="form-control s_website_form_input">
Expand Down

0 comments on commit dd50481

Please sign in to comment.