[ADD] survey_dropdown_simple_choice
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>
This commit is contained in:
11
survey_dropdown_simple_choice/models/survey_question.py
Normal file
11
survey_dropdown_simple_choice/models/survey_question.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class SurveyQuestion(models.Model):
|
||||
_inherit = 'survey.question'
|
||||
|
||||
display_dropdown = fields.Boolean(
|
||||
string="Display as dropdown list",
|
||||
help="Display this single choice question as a dropdown list instead "
|
||||
"of radio buttons. Ignored if the suggested answers contain images.",
|
||||
)
|
||||
Reference in New Issue
Block a user