[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:
RGA (OpenERP) 2011-05-13 15:51:19 +05:30
parent 4a6155d80c
commit e48c0c8ef2
1 changed files with 4 additions and 2 deletions

View File

@ -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)