diff --git a/sao/src/session.js b/sao/src/session.js index ab2d667e4f..4f61ddee58 100644 --- a/sao/src/session.js +++ b/sao/src/session.js @@ -112,6 +112,8 @@ this.reset_context(); var prm = Sao.rpc(args, this); return prm.then(context => { + context = Object.fromEntries(Object.entries(context).filter( + ([k, v]) => (k != 'locale') && !k.endsWith('.rec_name'))); jQuery.extend(this.context, context); this.store_context(); }); diff --git a/tryton/tryton/common/common.py b/tryton/tryton/common/common.py index 481df9602f..a5ca775f07 100644 --- a/tryton/tryton/common/common.py +++ b/tryton/tryton/common/common.py @@ -1293,10 +1293,15 @@ def RPCExecute(*args, **kwargs): def RPCContextReload(callback=None): + def clean(context): + return { + k: v for k, v in context.items() + if k != 'locale' and not k.endswith('.rec_name')} + def update(context): rpc.context_reset() try: - rpc.CONTEXT.update(context()) + rpc.CONTEXT.update(clean(context())) except RPCException: pass if callback: @@ -1306,7 +1311,7 @@ def RPCContextReload(callback=None): callback=update if callback else None) if not callback: rpc.context_reset() - rpc.CONTEXT.update(context) + rpc.CONTEXT.update(clean(context)) class Tooltips(object):