[FIX] correctly forward context in graph view
the new graph view silently ignored the context when doing its rpc read_group. Usually, it's not really a problem, which is why it is only now being fixed, but some models actually use the context in read_group. (for ex, account_entries_report)
This commit is contained in:
parent
c82bd1365c
commit
4c031b95d0
|
@ -86,6 +86,7 @@ instance.web_graph.GraphView = instance.web.View.extend({
|
||||||
col_group_by = groupbys.col_group_by;
|
col_group_by = groupbys.col_group_by;
|
||||||
|
|
||||||
if (!this.graph_widget) {
|
if (!this.graph_widget) {
|
||||||
|
this.widget_config.context = context;
|
||||||
if (group_by.length) {
|
if (group_by.length) {
|
||||||
this.widget_config.row_groupby = group_by;
|
this.widget_config.row_groupby = group_by;
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@ openerp.web_graph.PivotTable = openerp.web.Class.extend({
|
||||||
init: function (model, domain, fields, options) {
|
init: function (model, domain, fields, options) {
|
||||||
this.cells = [];
|
this.cells = [];
|
||||||
this.domain = domain;
|
this.domain = domain;
|
||||||
|
this.context = options.context;
|
||||||
this.no_data = true;
|
this.no_data = true;
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this.fields = fields;
|
this.fields = fields;
|
||||||
|
@ -379,6 +380,7 @@ openerp.web_graph.PivotTable = openerp.web.Class.extend({
|
||||||
|
|
||||||
return this.model.query(field_ids)
|
return this.model.query(field_ids)
|
||||||
.filter(domain)
|
.filter(domain)
|
||||||
|
.context(this.context)
|
||||||
.group_by(groupby.field)
|
.group_by(groupby.field)
|
||||||
.then(function (results) {
|
.then(function (results) {
|
||||||
var groups = _.filter(results, function (group) {
|
var groups = _.filter(results, function (group) {
|
||||||
|
|
Loading…
Reference in New Issue