[FIX] base_import: avoid name clash when importing ir.translation records. Call the...
authorMartin Trigaux <mat@openerp.com>
Thu, 13 Mar 2014 08:28:13 +0000 (09:28 +0100)
committerMartin Trigaux <mat@openerp.com>
Thu, 13 Mar 2014 08:28:13 +0000 (09:28 +0100)
This hack is needed in 7.0 to avoid changes in the API.
Renaming the load method of ir.translation is the proper solution for trunk (done in server revision 5018)

bzr revid: mat@openerp.com-20140313082813-afjsj912q2idrhl5

1  2 
addons/base_import/models.py

@@@ -316,8 -317,12 +317,12 @@@ class ir_import(orm.TransientModel)
              }]
  
          _logger.info('importing %d rows...', len(data))
-         import_result = self.pool[record.res_model].load(
-             cr, uid, import_fields, data, context=context)
+         # DO NOT FORWARD PORT, already fixed in trunk
+         # hack to avoid to call the load method from ir_translation (name clash)
+         if record.res_model == 'ir.translation':
 -            import_result = BaseModel.load(self.pool[record.res_model], cr, uid, import_fields, data, context=context)
++            import_result = BaseModel.load(self.pool['ir.translation'], cr, uid, import_fields, data, context=context)
+         else:
+             import_result = self.pool[record.res_model].load(cr, uid, import_fields, data, context=context)
          _logger.info('done')
  
          # If transaction aborted, RELEASE SAVEPOINT is going to raise