[FIX] module base_module_record Fixed when object has _rec_name
lp bug: https://launchpad.net/bugs/401184 fixed bzr revid: hda@hda-20090721052620-kho3ivnru3f8x27g
This commit is contained in:
@@ -128,8 +128,9 @@ class base_module_record(osv.osv):
|
||||
noupdate = noupdate or update
|
||||
if not id:
|
||||
field.setAttribute("model", fields[key]['relation'])
|
||||
name = self.pool.get(fields[key]['relation']).browse(cr, uid, val).name
|
||||
field.setAttribute("search", "[('name','=','"+name+"')]")
|
||||
fld_nm = self.pool.get(fields[key]['relation'])._rec_name
|
||||
name = self.pool.get(fields[key]['relation']).read(cr, uid, val,[fld_nm])[fld_nm] or False
|
||||
field.setAttribute("search", str([(str(fld_nm) ,'=', name)]))
|
||||
else:
|
||||
field.setAttribute("ref", id)
|
||||
record.appendChild(field)
|
||||
|
||||
Reference in New Issue
Block a user