Hey! i have quizz_score field in "survey.user_input" model . i want to put a check that if any value in it is negative then it must change to zero. It is already a computed field with this method
@api.depends('user_input_line_ids.quizz_mark')
def _compute_quizz_score(self):
for user_input in self:
user_input.quizz_score = sum(user_input.user_input_line_ids.mapped('quizz_mark'))
I have added the following lines under the same method but this ain't working
if user_input.quizz_score <= 0:
user_input.quizz_score = 0.00
Kindly help. Thanks in advance