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
=== modified file 'bin/osv/orm.py'
--- bin/osv/orm.py 2016-11-17 08:46:41 +0000
+++ bin/osv/orm.py 2016-12-13 15:16:07 +0000
@@ -1450,11 +1450,11 @@
1450 trans = translation_obj._get_source(cr, user, self._name, 'view', context['lang'], node.get('sum'))1450 trans = translation_obj._get_source(cr, user, self._name, 'view', context['lang'], node.get('sum'))
1451 if trans:1451 if trans:
1452 node.set('sum', trans)1452 node.set('sum', trans)
1453 elif node.get('confirm'):1453 if node.get('confirm'):
1454 trans = translation_obj._get_source(cr, user, self._name, 'view', context['lang'], node.get('confirm'))1454 trans = translation_obj._get_source(cr, user, self._name, 'view', context['lang'], node.get('confirm'))
1455 if trans:1455 if trans:
1456 node.set('confirm', trans)1456 node.set('confirm', trans)
1457 elif node.get('string'):1457 if node.get('string'):
1458 trans = translation_obj._get_source(cr, user, self._name, 'view', context['lang'], node.get('string'))1458 trans = translation_obj._get_source(cr, user, self._name, 'view', context['lang'], node.get('string'))
1459 if trans == node.get('string') and ('base_model_name' in context):1459 if trans == node.get('string') and ('base_model_name' in context):
1460 # If translation is same as source, perhaps we'd have more luck with the alternative model name1460 # If translation is same as source, perhaps we'd have more luck with the alternative model name
@@ -1462,7 +1462,7 @@
1462 trans = translation_obj._get_source(cr, user, context['base_model_name'], 'view', context['lang'], node.get('string'))1462 trans = translation_obj._get_source(cr, user, context['base_model_name'], 'view', context['lang'], node.get('string'))
1463 if trans:1463 if trans:
1464 node.set('string', trans)1464 node.set('string', trans)
1465 elif node.tag == 'translate':1465 if node.tag == 'translate':
1466 parent = node.getparent()1466 parent = node.getparent()
1467 source = node.text1467 source = node.text
1468 for child in node.getchildren():1468 for child in node.getchildren():

Subscribers

People subscribed via source and target branches