[FIX] Exporting of res.partner works again

Singleton object was required while access model properties, but search returns multiple results and hence caused traceback while accessing record.property
This commit is contained in:
Mohammed Shekha 2014-08-06 15:10:46 +05:30 committed by Richard Mathot
parent 87a870ccbd
commit e106ef91ef
1 changed files with 3 additions and 3 deletions

View File

@ -841,10 +841,10 @@ class BaseModel(object):
ir_model_data = self.sudo().env['ir.model.data']
data = ir_model_data.search([('model', '=', self._name), ('res_id', '=', self.id)])
if data:
if data.module:
return '%s.%s' % (data.module, data.name)
if data[0].module:
return '%s.%s' % (data[0].module, data[0].name)
else:
return data.name
return data[0].name
else:
postfix = 0
name = '%s_%s' % (self._table, self.id)