[MERGE] [FIX] ir_translation: backport of rev 5018 from trunk
authorMartin Trigaux <mat@openerp.com>
Tue, 31 Dec 2013 14:03:58 +0000 (15:03 +0100)
committerMartin Trigaux <mat@openerp.com>
Tue, 31 Dec 2013 14:03:58 +0000 (15:03 +0100)
rename method load to load_module_terms to avoid name clash with load call from base_import (opw 602531)

bzr revid: mat@openerp.com-20131231140358-ldh0snu9zmcs3tpw

openerp/addons/base/ir/ir_translation.py
openerp/addons/base/module/module.py
openerp/addons/base/tests/test_base.py

index 2ab93e2..c9eaa1c 100644 (file)
@@ -425,7 +425,7 @@ class ir_translation(osv.osv):
         """
         return ir_translation_import_cursor(cr, uid, self, context=context)
 
-    def load(self, cr, modules, langs, context=None):
+    def load_module_terms(self, cr, modules, langs, context=None):
         context = dict(context or {}) # local copy
         for module_name in modules:
             modpath = openerp.modules.get_module_path(module_name)
index e160c49..2f31852 100644 (file)
@@ -759,7 +759,7 @@ class module(osv.osv):
         elif not isinstance(filter_lang, (list, tuple)):
             filter_lang = [filter_lang]
         modules = [m.name for m in self.browse(cr, uid, ids) if m.state == 'installed']
-        self.pool.get('ir.translation').load(cr, modules, filter_lang, context=context)
+        self.pool.get('ir.translation').load_module_terms(cr, modules, filter_lang, context=context)
 
     def check(self, cr, uid, ids, context=None):
         for mod in self.browse(cr, uid, ids, context=context):
index 1ca66f5..4cc54ae 100644 (file)
@@ -311,7 +311,7 @@ class test_translation(common.TransactionCase):
         self.res_category = self.registry('res.partner.category')
         self.ir_translation = self.registry('ir.translation')
         cr, uid = self.cr, self.uid
-        self.registry('ir.translation').load(cr, ['base'], ['fr_FR'])
+        self.registry('ir.translation').load_module_terms(cr, ['base'], ['fr_FR'])
         self.cat_id = self.res_category.create(cr, uid, {'name': 'Customers'})
         self.ir_translation.create(cr, uid, {'name': 'res.partner.category,name', 'module':'base', 
             'value': 'Clients', 'res_id': self.cat_id, 'lang':'fr_FR', 'state':'translated', 'type': 'model'})