diff options
| author | Denis Ledoux <dle@odoo.com> | 2015-04-27 12:19:43 +0200 |
|---|---|---|
| committer | Denis Ledoux <dle@odoo.com> | 2015-04-27 12:19:43 +0200 |
| commit | d6ae7fb7dbd2ae4eec32e4cd5bc3649feef0784e (patch) | |
| tree | 59ce4e3e7cc67695b8a84c030bf428076d7c809e /addons/project/project.py | |
| parent | 9323f2b4c75d61a4169efceabac08e09f03d6062 (diff) | |
| parent | 3e7d3c7ee4f8838e0a9c347eca016e746175a634 (diff) | |
[MERGE] forward port of branch 7.0 up to 3e7d3c7
Diffstat (limited to 'addons/project/project.py')
| -rw-r--r-- | addons/project/project.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/addons/project/project.py b/addons/project/project.py index 1321defd9c7..d165afc8005 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -1103,13 +1103,20 @@ class task(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.stage_id and task.stage_id.fold: 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,)) |
