diff --git a/addons/project/project.py b/addons/project/project.py index 080e72f7678..35d2736a722 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -1179,13 +1179,20 @@ class task(base_stage, osv.osv): context = context or {} result = "" ident = ' '*ident + company = self.pool["res.users"].browse(cr, uid, uid, context=context).company_id + duration_uom = { + 'day(s)': 'd', 'days': 'd', 'day': 'd', 'd': 'd', + 'month(s)': 'm', 'months': 'm', 'month': 'month', 'm': 'm', + 'week(s)': 'w', 'weeks': 'w', 'week': 'w', 'w': 'w', + 'hour(s)': 'h', 'hours': 'H', 'hour': 'H', 'h': 'H', + }.get(company.project_time_mode_id.name.lower(), "hour(s)") for task in tasks: if task.state in ('done','cancelled'): continue result += ''' %sdef Task_%s(): -%s todo = \"%.2fH\" -%s effort = \"%.2fH\"''' % (ident,task.id, ident,task.remaining_hours, ident,task.total_hours) +%s todo = \"%.2f%s\" +%s effort = \"%.2f%s\"''' % (ident, task.id, ident, task.remaining_hours, duration_uom, ident, task.total_hours, duration_uom) start = [] for t2 in task.parent_ids: start.append("up.Task_%s.end" % (t2.id,))