summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Trigaux <mat@openerp.com>2014-03-12 15:05:15 +0100
committerMartin Trigaux <mat@openerp.com>2014-03-12 15:05:15 +0100
commitc9bca78bb166d3d227371b49fbf9f333561e8bbb (patch)
treee0859098baadc9c9121f2c665aa4b989a3894f3e
parent6ab74d0d8db3bc72940d25c95db84d05fc5e55fb (diff)
[FIX] base_import: avoid name clash when importing ir.translation records. Call the orm method directly.
This hack is needed in 7.0 to avoid changes in the API. Renaming the method is the proper solution for trunk (done revision 5018) bzr revid: mat@openerp.com-20140312140515-tisj9cye0mzfprsw
-rw-r--r--addons/base_import/models.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/addons/base_import/models.py b/addons/base_import/models.py
index 996dbf7964d..3fd34b98bfe 100644
--- a/addons/base_import/models.py
+++ b/addons/base_import/models.py
@@ -11,6 +11,7 @@ except ImportError:
import psycopg2
from openerp.osv import orm, fields
+from openerp.osv.orm import BaseModel
from openerp.tools.translate import _
FIELDS_RECURSION_LIMIT = 2
@@ -316,8 +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)
+ 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