From 59c3a65f7f10427c23805b167369e6d0377422b0 Mon Sep 17 00:00:00 2001 From: Olzah Date: Sun, 27 Aug 2023 16:29:27 +0200 Subject: [PATCH] [INZ-044] fix: add fix bugs * Some fixes in add survey_rating_method --- addons/elearnmacomod/wizard/survey_ratings_wizard.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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!')