[FIX] survey: allow duplicate user answer
No reason to prevent as long as remove token Fixes #7983, Closes #8009
This commit is contained in:
parent
9b489e9d7c
commit
8f2057a1c7
|
@ -848,7 +848,7 @@ class survey_user_input(osv.Model):
|
|||
'survey_id': fields.many2one('survey.survey', 'Survey', required=True,
|
||||
readonly=1, ondelete='restrict'),
|
||||
'date_create': fields.datetime('Creation Date', required=True,
|
||||
readonly=1),
|
||||
readonly=1, copy=False),
|
||||
'deadline': fields.datetime("Deadline",
|
||||
help="Date by which the person can open the survey and submit answers",
|
||||
oldname="date_deadline"),
|
||||
|
@ -861,7 +861,7 @@ class survey_user_input(osv.Model):
|
|||
'Status',
|
||||
readonly=True),
|
||||
'test_entry': fields.boolean('Test entry', readonly=1),
|
||||
'token': fields.char("Identification token", readonly=1, required=1),
|
||||
'token': fields.char("Identification token", readonly=1, required=1, copy=False),
|
||||
|
||||
# Optional Identification data
|
||||
'partner_id': fields.many2one('res.partner', 'Partner', readonly=1),
|
||||
|
@ -872,7 +872,7 @@ class survey_user_input(osv.Model):
|
|||
'Last displayed page'),
|
||||
# The answers !
|
||||
'user_input_line_ids': fields.one2many('survey.user_input_line',
|
||||
'user_input_id', 'Answers'),
|
||||
'user_input_id', 'Answers', copy=True),
|
||||
|
||||
# URLs used to display the answers
|
||||
'result_url': fields.related('survey_id', 'result_url', type='char',
|
||||
|
@ -895,10 +895,6 @@ class survey_user_input(osv.Model):
|
|||
('deadline_in_the_past', 'CHECK (deadline >= date_create)', 'The deadline cannot be in the past')
|
||||
]
|
||||
|
||||
def copy_data(self, cr, uid, id, default=None, context=None):
|
||||
raise osv.except_osv(_('Warning!'), _('You cannot duplicate this \
|
||||
element!'))
|
||||
|
||||
def do_clean_emptys(self, cr, uid, automatic=False, context=None):
|
||||
''' Remove empty user inputs that have been created manually
|
||||
(used as a cronjob declared in data/survey_cron.xml) '''
|
||||
|
@ -1027,10 +1023,6 @@ class survey_user_input_line(osv.Model):
|
|||
vals.update({'quizz_mark': self.__get_mark(cr, uid, value_suggested)})
|
||||
return super(survey_user_input_line, self).write(cr, uid, ids, vals, context=context)
|
||||
|
||||
def copy_data(self, cr, uid, id, default=None, context=None):
|
||||
raise osv.except_osv(_('Warning!'), _('You cannot duplicate this \
|
||||
element!'))
|
||||
|
||||
def save_lines(self, cr, uid, user_input_id, question, post, answer_tag,
|
||||
context=None):
|
||||
''' Save answers to questions, depending on question type
|
||||
|
|
Loading…
Reference in New Issue