[FIX]document : Display webdav folder names in user s language instead of only English

bzr revid: mma@tinyerp.com-20121101113434-00waekqwlteufser
This commit is contained in:
Nehal Panchal 2012-11-01 17:04:34 +05:30 committed by Mayur Maheshwari (OpenERP)
parent b006809773
commit c91ff5bbaa
2 changed files with 3 additions and 1 deletions

View File

@ -823,6 +823,7 @@ class node_res_dir(node_class):
uid = self.context.uid uid = self.context.uid
ctx = self.context.context.copy() ctx = self.context.context.copy()
ctx.update(self.dctx) ctx.update(self.dctx)
ctx.update(self.context.extra_ctx)
where = [] where = []
if self.domain: if self.domain:
app = safe_eval(self.domain, ctx) app = safe_eval(self.domain, ctx)

View File

@ -51,9 +51,10 @@ class document_davdir(osv.osv):
# that might be not worth preparing. # that might be not worth preparing.
nctx.extra_ctx['webdav_path'] = '/'+config.get_misc('webdav','vdir','webdav') nctx.extra_ctx['webdav_path'] = '/'+config.get_misc('webdav','vdir','webdav')
usr_obj = self.pool.get('res.users') usr_obj = self.pool.get('res.users')
res = usr_obj.read(cr, uid, uid, ['login']) res = usr_obj.read(cr, uid, uid, ['login','context_lang'])
if res: if res:
nctx.extra_ctx['username'] = res['login'] nctx.extra_ctx['username'] = res['login']
nctx.extra_ctx['lang'] = res['context_lang']
# TODO group # TODO group
return return