From 509c95561b314db20eb276dfdd8714935fe3fb21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 27 Aug 2015 12:28:43 +0200 Subject: [PATCH] Define effort_hours on Work in project instead of project_invoice effort_duration is defined in project module so effort_hours should also. issue4937 --- work.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/work.py b/work.py index b7250fab5f..16e6902caa 100644 --- a/work.py +++ b/work.py @@ -159,6 +159,12 @@ class Work(ModelSQL, ModelView): 'child': child.rec_name, }) + @property + def effort_hours(self): + if not self.effort_duration: + return 0 + return self.effort_duration.total_seconds() / 60 / 60 + def get_rec_name(self, name): return self.work.name