From 41e8b3f92c74a09fbdb524ee7ecaa7c788dfd010 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 6 Dec 2011 12:31:41 +0100 Subject: [FIX] correctly send context during graph's fields_get lp bug: https://launchpad.net/bugs/898636 fixed bzr revid: xmo@openerp.com-20111206113141-nbfxp0jx4lrgo95g --- addons/web/controllers/main.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'addons/web/controllers') diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index f811f77b34c..d500ad0684e 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -778,12 +778,15 @@ class DataSet(openerpweb.Controller): return Model.unlink(ids, req.session.eval_context(req.context)) def call_common(self, req, model, method, args, domain_id=None, context_id=None): - domain = args[domain_id] if domain_id and len(args) - 1 >= domain_id else [] - context = args[context_id] if context_id and len(args) - 1 >= context_id else {} + has_domain = domain_id is not None and domain_id < len(args) + has_context = context_id is not None and context_id < len(args) + + domain = args[domain_id] if has_domain else [] + context = args[context_id] if has_context else {} c, d = eval_context_and_domain(req.session, context, domain) - if domain_id and len(args) - 1 >= domain_id: + if has_domain: args[domain_id] = d - if context_id and len(args) - 1 >= context_id: + if has_context: args[context_id] = c for i in xrange(len(args)): -- cgit v1.2.3