diff --git a/addons/elearnmacomod/wizard/survey_ratings_wizard.py b/addons/elearnmacomod/wizard/survey_ratings_wizard.py index 4a1d483..dd531ed 100644 --- a/addons/elearnmacomod/wizard/survey_ratings_wizard.py +++ b/addons/elearnmacomod/wizard/survey_ratings_wizard.py @@ -18,11 +18,14 @@ def _get_active_rec_id(self): survey_ids = fields.Many2one('survey.survey', string='Survey', default=_get_active_rec_id) opinion = fields.Char(string='Comment', required=True) user_rating = fields.Selection( - [('1', 'Label 1'), ('2', 'Label 2'), ('3', 'Label 3'), ('4', 'Label 4'), ('5', 'Label 5')], string='Set Rating', required=True) + [('1', 'Label 1'), ('2', 'Label 2'), ('3', 'Label 3'), ('4', 'Label 4'), ('5', 'Label 5')], string='Set Rating', + required=True) def add_survey_ratings(self): current_survey = self.env['survey.survey'].search([('id', '=', self.survey_ids.id)]) - count_review = current_survey.user_input_ids.filtered(lambda record: record.partner_id.id == self.reviewer_id.user_partner_id.id and record.state == 'done') + count_review = (current_survey.user_input_ids. + filtered(lambda record: record.partner_id.id == self.reviewer_id.user_partner_id.id and record. + state == 'done')) if len(count_review) == 0: raise UserError('Sorry, You cant rate this Survey! You have to finish the course first!')