Skip to content
Snippets Groups Projects
Commit 87e5de79 authored by Benjamin's avatar Benjamin
Browse files

fix bug division by 0

parent c66a691e
No related branches found
No related tags found
No related merge requests found
...@@ -109,7 +109,9 @@ class Training(models.Model): ...@@ -109,7 +109,9 @@ class Training(models.Model):
@api.depends('student_ids', 'cost') @api.depends('student_ids', 'cost')
def _compute_costs(self): def _compute_costs(self):
if self.students_count > 0:
self.student_cost = self.cost / self.students_count self.student_cost = self.cost / self.students_count
if self.hours_total > 0:
self.rate = self.cost / self.hours_total self.rate = self.cost / self.hours_total
@api.depends('session_ids') @api.depends('session_ids')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment