Merge lp:~syleam/openobject-addons/trunk-lp-1080191-sla into lp:openobject-addons

Proposed by Sebastien LANGE - http://www.Syleam.fr
Status: Needs review
Proposed branch: lp:~syleam/openobject-addons/trunk-lp-1080191-sla
Merge into: lp:openobject-addons
Diff against target: 23 lines (+5/-1)
1 file modified
project/project.py (+5/-1)
To merge this branch: bzr merge lp:~syleam/openobject-addons/trunk-lp-1080191-sla
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+134784@code.launchpad.net
To post a comment you must log in.

Unmerged revisions

8072. By Sebastien LANGE - http://www.Syleam.fr

[FIX] Widget float_time in project task if 'Hour' is translate

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'project/project.py'
2--- project/project.py 2012-11-15 12:38:51 +0000
3+++ project/project.py 2012-11-17 21:40:27 +0000
4@@ -887,6 +887,10 @@
5 # Override view according to the company definition
6 def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
7 users_obj = self.pool.get('res.users')
8+ translation_obj = self.pool.get('ir.translation')
9+ is_hour = translation_obj.search(cr, uid, [('name', '=', 'product.uom,name'), ('src', 'in', ['Hour', 'Hours'])])
10+ translated = [str(i.value) for i in translation_obj.browse(cr, uid, is_hour, context=context)]
11+ translated.extend(['Hour','Hours'])
12 if context is None: context = {}
13 # read uom as admin to avoid access rights issues, e.g. for portal/share users,
14 # this should be safe (no context passed to avoid side-effects)
15@@ -895,7 +899,7 @@
16
17 res = super(task, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar, submenu=submenu)
18
19- if tm in ['Hours','Hour']:
20+ if tm in translated:
21 return res
22
23 eview = etree.fromstring(res['arch'])

Subscribers

People subscribed via source and target branches

to all changes: