Merge lp:~fabien-morin/unifield-server/fm-fix-orm-translation into lp:unifield-server

Proposed by Fabien MORIN
Status: Merged
Merged at revision: 4123
Proposed branch: lp:~fabien-morin/unifield-server/fm-fix-orm-translation
Merge into: lp:unifield-server
Diff against target: 26 lines (+3/-3)
1 file modified
bin/osv/orm.py (+3/-3)
To merge this branch: bzr merge lp:~fabien-morin/unifield-server/fm-fix-orm-translation
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+313143@code.launchpad.net

Description of the change

Found a bug in the way forms are translated (only one attribute of each node where some of them can have many attributes to translate : string and confirm for example).

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/osv/orm.py'
2--- bin/osv/orm.py 2016-11-17 08:46:41 +0000
3+++ bin/osv/orm.py 2016-12-13 15:16:07 +0000
4@@ -1450,11 +1450,11 @@
5 trans = translation_obj._get_source(cr, user, self._name, 'view', context['lang'], node.get('sum'))
6 if trans:
7 node.set('sum', trans)
8- elif node.get('confirm'):
9+ if node.get('confirm'):
10 trans = translation_obj._get_source(cr, user, self._name, 'view', context['lang'], node.get('confirm'))
11 if trans:
12 node.set('confirm', trans)
13- elif node.get('string'):
14+ if node.get('string'):
15 trans = translation_obj._get_source(cr, user, self._name, 'view', context['lang'], node.get('string'))
16 if trans == node.get('string') and ('base_model_name' in context):
17 # If translation is same as source, perhaps we'd have more luck with the alternative model name
18@@ -1462,7 +1462,7 @@
19 trans = translation_obj._get_source(cr, user, context['base_model_name'], 'view', context['lang'], node.get('string'))
20 if trans:
21 node.set('string', trans)
22- elif node.tag == 'translate':
23+ if node.tag == 'translate':
24 parent = node.getparent()
25 source = node.text
26 for child in node.getchildren():

Subscribers

People subscribed via source and target branches