Display "Multiple choice: only one answer" (simple_choice) survey questions as a dropdown list instead of radio buttons, per question. The select is mirrored on hidden radios so that the native survey form pipeline (validation, conditional questions, "Other" comment, AJAX submit, correct answers display) keeps working. Native radio rendering is kept when suggested answers contain images and in readonly mode. Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
14 lines
571 B
XML
14 lines
571 B
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<record id="survey_question_form_dropdown" model="ir.ui.view">
|
|
<field name="name">survey.question.form.dropdown</field>
|
|
<field name="model">survey.question</field>
|
|
<field name="inherit_id" ref="survey.survey_question_form"/>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//field[@name='comments_allowed']" position="before">
|
|
<field name="display_dropdown" invisible="question_type != 'simple_choice'"/>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
</odoo>
|