[IMP] fields.reference: two loops one loop.
bzr revid: vmt@openerp.com-20111005105103-cutnuvfkgsjej3vc
This commit is contained in:
parent
2fd484263a
commit
7ccc7f388f
|
@ -164,14 +164,13 @@ class reference(_column):
|
||||||
def get(self, cr, obj, ids, name, uid=None, context=None, values=None):
|
def get(self, cr, obj, ids, name, uid=None, context=None, values=None):
|
||||||
result = {}
|
result = {}
|
||||||
# copy initial values fetched previously.
|
# copy initial values fetched previously.
|
||||||
for row in values:
|
for value in values:
|
||||||
result[row['id']] = row[name]
|
if value[name]:
|
||||||
# verify target object exists
|
model, res_id = value[name].split(',')
|
||||||
for id, value in result.iteritems():
|
if obj.pool.get(model).exists(cr, uid, [int(res_id)], context=context):
|
||||||
if value:
|
result[value['id']] = value[name]
|
||||||
model, res_id = value.split(',')
|
else:
|
||||||
if not obj.pool.get(model).exists(cr, uid, [int(res_id)], context=context):
|
result[value['id']] = False
|
||||||
result[id] = False
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
class char(_column):
|
class char(_column):
|
||||||
|
|
Loading…
Reference in New Issue