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

[fix] erreur calcul heures

parent 8e1adcd4
No related branches found
No related tags found
No related merge requests found
...@@ -26,9 +26,15 @@ class SapovalPartners(models.Model): ...@@ -26,9 +26,15 @@ class SapovalPartners(models.Model):
@api.one @api.one
def _total_heures_passees(self): def _total_heures_passees(self):
res = 0.0 res = 0.0
for record in self.task_ids: account = self.analytic_account_id.id
res = res + record.effective_hours ############## Calcul couts annexes ################
self.lf_heures_passees = res self.env.cr.execute("select sum(unit_amount) from account_analytic_line where is_timesheet=TRUE and account_id=%s;", (account, ) )
heures_passees = self.env.cr.fetchone()[0]
if heures_passees:
self.lf_heures_passees = heures_passees
else:
self.lf_heures_passees = 0.0
@api.one @api.one
def _total_heures_planifiees(self): def _total_heures_planifiees(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment