[FIX] correctly send context during graph's fields_get
lp bug: https://launchpad.net/bugs/898636 fixed bzr revid: xmo@openerp.com-20111206113141-nbfxp0jx4lrgo95g
This commit is contained in:
parent
0eab577b40
commit
41e8b3f92c
|
@ -778,12 +778,15 @@ class DataSet(openerpweb.Controller):
|
||||||
return Model.unlink(ids, req.session.eval_context(req.context))
|
return Model.unlink(ids, req.session.eval_context(req.context))
|
||||||
|
|
||||||
def call_common(self, req, model, method, args, domain_id=None, context_id=None):
|
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 []
|
has_domain = domain_id is not None and domain_id < len(args)
|
||||||
context = args[context_id] if context_id and len(args) - 1 >= context_id else {}
|
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)
|
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
|
args[domain_id] = d
|
||||||
if context_id and len(args) - 1 >= context_id:
|
if has_context:
|
||||||
args[context_id] = c
|
args[context_id] = c
|
||||||
|
|
||||||
for i in xrange(len(args)):
|
for i in xrange(len(args)):
|
||||||
|
|
|
@ -425,8 +425,8 @@ openerp.web.DataSet = openerp.web.Widget.extend( /** @lends openerp.web.DataSet
|
||||||
return this.rpc('/web/dataset/call', {
|
return this.rpc('/web/dataset/call', {
|
||||||
model: this.model,
|
model: this.model,
|
||||||
method: method,
|
method: method,
|
||||||
domain_id: domain_index || null,
|
domain_id: domain_index == undefined ? null : domain_index,
|
||||||
context_id: context_index || null,
|
context_id: context_index == undefined ? null : context_index,
|
||||||
args: args || []
|
args: args || []
|
||||||
}, callback, error_callback);
|
}, callback, error_callback);
|
||||||
},
|
},
|
||||||
|
|
|
@ -57,7 +57,7 @@ openerp.web_graph.GraphView = openerp.web.View.extend({
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return $.when(
|
return $.when(
|
||||||
this.dataset.call('fields_get', []),
|
this.dataset.call_and_eval('fields_get', [false, {}], null, 1),
|
||||||
loaded)
|
loaded)
|
||||||
.then(function (fields_result, view_result) {
|
.then(function (fields_result, view_result) {
|
||||||
self.fields = fields_result[0];
|
self.fields = fields_result[0];
|
||||||
|
|
Loading…
Reference in New Issue