diff options
| author | Christophe Simonis <chs@odoo.com> | 2015-05-26 17:34:04 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2015-05-28 14:27:38 +0200 |
| commit | fe2b5f35a40ca8df662130608b0f89427a196362 (patch) | |
| tree | 0c7773f0599f3b1e6dbb869104fad0b04869b269 /addons/project/project.py | |
| parent | d4d8a2eae31e7a6a45029b84603e055300e3be36 (diff) | |
| parent | bf1e99964cdbc374f8a0c4cec1b338bf7c7c2930 (diff) | |
[MERGE] forward port of branch saas-6 up to bf1e999
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 7abab996c56..d57e91d007d 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -900,13 +900,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._get_total_hours()) +%s todo = \"%.2f%s\" +%s effort = \"%.2f%s\"''' % (ident, task.id, ident, task.remaining_hours, duration_uom, ident, task._get_total_hours(), duration_uom) start = [] for t2 in task.parent_ids: start.append("up.Task_%s.end" % (t2.id,)) |
