[Fix] Set default value for current login user
lp bug: https://launchpad.net/bugs/780418 fixed bzr revid: rga@tinyerp.com-20110513102119-aw4n336m5wcm0c9o
This commit is contained in:
parent
4a6155d80c
commit
e48c0c8ef2
|
@ -172,8 +172,10 @@ class ir_values(osv.osv):
|
|||
else:
|
||||
where.append('res_id=%s')
|
||||
params.append(res_id)
|
||||
|
||||
where.append('(user_id=%s or (user_id IS NULL)) order by id')
|
||||
order = 'id'
|
||||
if key == 'default':
|
||||
order = 'user_id'
|
||||
where.append('(user_id=%s or (user_id IS NULL)) order by '+ order)
|
||||
params.append(uid)
|
||||
clause = ' and '.join(where)
|
||||
cr.execute('select id,name,value,object,meta, key from ir_values where ' + clause, params)
|
||||
|
|
Loading…
Reference in New Issue