[FIX] survey: fix some issues
== Fix results scored question display == This commit fixes the display for scored choice question. The text "Right answer" was displayed twice. == Add default values to avoid constraints inconsistencies == This commit adds a 0 default values to some of our validation fields on survey questions. Without a default value, the ORM would store "NULL" in the fields and then allow users to define a "min" without a "max", that would result in an error while trying to validate the answers to that question. Furthermore, when creating a question from the frontend, the web framework will always send 0 for all field values anyway. The code change adds consistency and avoids potential errors on that issue. LINKS Task 2208574 closes odoo/odoo#48371 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
committed by
Thibault Delavallée
parent
549968bdfe
commit
c5ae9b38d1
@@ -123,10 +123,10 @@ class SurveyQuestion(models.Model):
|
||||
# question validation
|
||||
validation_required = fields.Boolean('Validate entry')
|
||||
validation_email = fields.Boolean('Input must be an email')
|
||||
validation_length_min = fields.Integer('Minimum Text Length')
|
||||
validation_length_max = fields.Integer('Maximum Text Length')
|
||||
validation_min_float_value = fields.Float('Minimum value')
|
||||
validation_max_float_value = fields.Float('Maximum value')
|
||||
validation_length_min = fields.Integer('Minimum Text Length', default=0)
|
||||
validation_length_max = fields.Integer('Maximum Text Length', default=0)
|
||||
validation_min_float_value = fields.Float('Minimum value', default=0.0)
|
||||
validation_max_float_value = fields.Float('Maximum value', default=0.0)
|
||||
validation_min_date = fields.Date('Minimum Date')
|
||||
validation_max_date = fields.Date('Maximum Date')
|
||||
validation_min_datetime = fields.Datetime('Minimum Datetime')
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
</strong>
|
||||
</t>
|
||||
</t>
|
||||
<t t-if="question.is_scored_question">
|
||||
<t t-elif="question.is_scored_question">
|
||||
<span>Right answer:</span>
|
||||
<strong>
|
||||
<t t-if="question.question_type == 'numerical_box'">
|
||||
|
||||
Reference in New Issue
Block a user