Skip to content

Commit

Permalink
Merge pull request odoo#508 from odoo-dev/master-survey-fix-rim
Browse files Browse the repository at this point in the history
[FIX] survey: ordering of questions/labels was buggy
  • Loading branch information
rim-odoo committed Jun 12, 2014
2 parents a3cfed1 + b7137a5 commit 114e95b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions addons/survey/survey.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class survey_stage(osv.Model):

_name = 'survey.stage'
_description = 'Survey Stage'
_order = 'sequence asc'
_order = 'sequence,id'

_columns = {
'name': fields.char(string="Name", required=True, translate=True),
Expand Down Expand Up @@ -497,7 +497,7 @@ class survey_page(osv.Model):
_name = 'survey.page'
_description = 'Survey Page'
_rec_name = 'title'
_order = 'sequence'
_order = 'sequence,id'

# Model Fields #

Expand Down Expand Up @@ -536,7 +536,7 @@ class survey_question(osv.Model):
_name = 'survey.question'
_description = 'Survey Question'
_rec_name = 'question'
_order = 'sequence'
_order = 'sequence,id'

# Model fields #

Expand Down Expand Up @@ -793,7 +793,7 @@ class survey_label(osv.Model):
''' A suggested answer for a question '''
_name = 'survey.label'
_rec_name = 'value'
_order = 'sequence'
_order = 'sequence,id'
_description = 'Survey Label'

def _check_question_not_empty(self, cr, uid, ids, context=None):
Expand All @@ -812,8 +812,8 @@ def _check_question_not_empty(self, cr, uid, ids, context=None):
required=True),
'quizz_mark': fields.float('Score for this answer', help="A positive score indicates a correct answer; a negative or null score indicates a wrong answer"),
}
defaults = {
'sequence': 100,
_defaults = {
'sequence': 10,
}
_constraints = [
(_check_question_not_empty, "A label must be attached to one and only one question", ['question_id', 'question_id_2'])
Expand Down

0 comments on commit 114e95b

Please sign in to comment.