[FIX] translations: fix tests to adapt to new duplication behaviour and remove context hack in copy_data (translations are now fully handled in copy_translation)
bzr revid: mat@openerp.com-20131125115727-o9oejao1ziagqti1
This commit is contained in:
parent
fbbc6ea840
commit
3b5cf5d56c
|
@ -340,10 +340,10 @@ class test_translation(common.TransactionCase):
|
|||
self.new_fr_cat_id = self.res_category.copy(cr, uid, self.cat_id, default={'name': 'Clients (copie)'}, context={'lang':'fr_FR'})
|
||||
|
||||
no_context_cat = self.res_category.browse(cr, uid, self.new_fr_cat_id)
|
||||
self.assertEqual(no_context_cat.name, 'Clients (copie)', "Duplication with default value not applied")
|
||||
self.assertEqual(no_context_cat.name, 'Customers', "Duplication erased original untranslated value")
|
||||
|
||||
fr_context_cat = self.res_category.browse(cr, uid, self.new_fr_cat_id, context={'lang':'fr_FR'})
|
||||
self.assertEqual(fr_context_cat.name, 'Clients', "Did not found translation for initial value")
|
||||
self.assertEqual(fr_context_cat.name, 'Clients (copie)', "Did not used default value for translated value")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
@ -4930,10 +4930,7 @@ class BaseModel(object):
|
|||
else:
|
||||
default['state'] = self._defaults['state']
|
||||
|
||||
context_wo_lang = context.copy()
|
||||
if 'lang' in context:
|
||||
del context_wo_lang['lang']
|
||||
data = self.read(cr, uid, [id,], context=context_wo_lang)
|
||||
data = self.read(cr, uid, [id,], context=context)
|
||||
if data:
|
||||
data = data[0]
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue