[MERGE] osv,ir_model: fixes for fnct_search implementations returning [] + ir.model.data passing browse_records to create()

bzr revid: odo@openerp.com-20110117204932-8ldxndduwqsdyofc
This commit is contained in:
P. Christeas 2011-01-17 21:49:32 +01:00 committed by Olivier Dony
commit e29e641514
2 changed files with 11 additions and 8 deletions

View File

@ -652,7 +652,7 @@ class ir_model_data(osv.osv):
'name': xml_id + '_' + table.replace('.', '_'),
'model': table,
'module': module,
'res_id': inherit_id,
'res_id': inherit_id.id,
'noupdate': noupdate,
},context=context)
else:
@ -674,7 +674,7 @@ class ir_model_data(osv.osv):
'name': xml_id + '_' + table.replace('.', '_'),
'model': table,
'module': module,
'res_id': inherit_id,
'res_id': inherit_id.id,
'noupdate': noupdate,
},context=context)
if xml_id:

View File

@ -167,12 +167,15 @@ class expression(object):
self.__exp[i] = self.__DUMMY_LEAF
else:
subexp = field.search(cr, uid, table, left, [self.__exp[i]], context=context)
# we assume that the expression is valid
# we create a dummy leaf for forcing the parsing of the resulting expression
self.__exp[i] = '&'
self.__exp.insert(i + 1, self.__DUMMY_LEAF)
for j, se in enumerate(subexp):
self.__exp.insert(i + 2 + j, se)
if not subexp:
self.__exp[i] = self.__DUMMY_LEAF
else:
# we assume that the expression is valid
# we create a dummy leaf for forcing the parsing of the resulting expression
self.__exp[i] = '&'
self.__exp.insert(i + 1, self.__DUMMY_LEAF)
for j, se in enumerate(subexp):
self.__exp.insert(i + 2 + j, se)
# else, the value of the field is store in the database, so we search on it
elif field._type == 'one2many':