summaryrefslogtreecommitdiff
path: root/addons/base_graph/static/src/js/graph.js
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2011-07-20 10:24:55 +0200
committerXavier Morel <xmo@openerp.com>2011-07-20 10:24:55 +0200
commita2318ec9685b6c3d6399b9a4795d2f093790a885 (patch)
tree1df38277f9118076dc44321b4319b1edc6574545 /addons/base_graph/static/src/js/graph.js
parentf59a0b6025c26d5dacda277fbbfc89a29c6475a5 (diff)
parent9a6c3ca614f80671820362c5636e6f6b1d180489 (diff)
[FIX] domains and contexts on view switch to form, as well as fixing list of fields provided to DataSet.read_slice
bzr revid: xmo@openerp.com-20110720082455-ghudln3hhbmgjbum
Diffstat (limited to 'addons/base_graph/static/src/js/graph.js')
-rw-r--r--addons/base_graph/static/src/js/graph.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/addons/base_graph/static/src/js/graph.js b/addons/base_graph/static/src/js/graph.js
index cf4cca20e59..25ce024638b 100644
--- a/addons/base_graph/static/src/js/graph.js
+++ b/addons/base_graph/static/src/js/graph.js
@@ -76,12 +76,20 @@ openerp.base_graph.GraphView = openerp.base.View.extend({
load_chart: function(data) {
var self = this;
+ var domain = false;
if(data){
this.x_title = this.all_fields[this.chart_info_fields]['string'];
this.y_title = this.all_fields[this.operator_field]['string'];
self.schedule_chart(data);
}else{
- this.dataset.read_slice(this.fields, 0, false, function(res) {
+ if(! _.isEmpty(this.view_manager.dataset.domain)){
+ domain = this.view_manager.dataset.domain;
+ }else if(! _.isEmpty(this.view_manager.action.domain)){
+ domain = this.view_manager.action.domain;
+ }
+ this.dataset.domain = domain;
+ this.dataset.context = this.view_manager.dataset.context;
+ this.dataset.read_slice(_(this.fields).keys(), 0, false, function(res) {
self.schedule_chart(res);
});
}