diff options
| author | Cecile Tonglet <cto@openerp.com> | 2012-12-17 15:43:06 +0100 |
|---|---|---|
| committer | Cecile Tonglet <cto@openerp.com> | 2012-12-17 15:43:06 +0100 |
| commit | 15fe5156011f67b575aa5f819d52735cb999b3c8 (patch) | |
| tree | 30f0466d251ecb4669b600445e07778b26a3fa86 /addons/project_long_term/project_long_term.py | |
| parent | 6072fd11afb076b1781e23096a8c8794df3a00c7 (diff) | |
| parent | d7461fb1c813590d70ddecaeff65c02a1029d61b (diff) | |
[MERGE] From trunk
bzr revid: cto@openerp.com-20121217144306-tkodwpox30cuvb28
Diffstat (limited to 'addons/project_long_term/project_long_term.py')
| -rw-r--r-- | addons/project_long_term/project_long_term.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/addons/project_long_term/project_long_term.py b/addons/project_long_term/project_long_term.py index fbf4b7e39a6..e53ff9ed253 100644 --- a/addons/project_long_term/project_long_term.py +++ b/addons/project_long_term/project_long_term.py @@ -123,7 +123,6 @@ class project_phase(osv.osv): _defaults = { 'state': 'draft', 'sequence': 10, - 'product_uom': lambda self,cr,uid,c: self.pool.get('product.uom').search(cr, uid, [('name', '=', _('Day'))], context=c)[0] } _order = "project_id, date_start, sequence" _constraints = [ @@ -169,11 +168,12 @@ class project_phase(osv.osv): for phase in phases: if phase.state in ('done','cancelled'): continue + # FIXME: brittle and not working if context['lang'] != 'en_US' duration_uom = { - 'days': 'd', 'day': 'd', 'd':'d', - 'months': 'm', 'month':'month', 'm':'m', - 'weeks': 'w', 'week': 'w', 'w':'w', - 'hours': 'H', 'hour': 'H', 'h':'H', + '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(phase.product_uom.name.lower(), "H") duration = str(phase.duration) + duration_uom result += ''' |
