summaryrefslogtreecommitdiff
path: root/addons/web_graph/static/src
diff options
context:
space:
mode:
authorVo Minh Thu <vmt@openerp.com>2012-01-18 11:12:52 +0100
committerVo Minh Thu <vmt@openerp.com>2012-01-18 11:12:52 +0100
commit75b3fc0907ee873c6e16d1fa8e8bfe58d4f520c1 (patch)
tree3e7f7bbe9110eeae766b46bb9c16a867579b6452 /addons/web_graph/static/src
parent3203d264aecd751a8c261cea4f72fa323a3098be (diff)
parent152f92916bc36d00c0e59fbc49fb655a4fd85908 (diff)
[MERGE] merged trunk.
bzr revid: vmt@openerp.com-20120118101252-e81nlyzym2nkebf4
Diffstat (limited to 'addons/web_graph/static/src')
-rw-r--r--addons/web_graph/static/src/js/graph.js36
1 files changed, 21 insertions, 15 deletions
diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js
index b7eed2dcdc3..f153a2155f0 100644
--- a/addons/web_graph/static/src/js/graph.js
+++ b/addons/web_graph/static/src/js/graph.js
@@ -389,27 +389,33 @@ openerp.web_graph.GraphView = openerp.web.View.extend({
// unconditionally nuke tooltips before switching view
$(".dhx_tooltip").remove('div');
id = id[this.abscissa];
+ if(this.fields[this.abscissa].type == "selection"){
+ id = _.detect(this.fields[this.abscissa].selection,function(select_value){
+ return _.include(select_value, id);
+ });
+ }
if (typeof id == 'object'){
id = id[0];
}
- var record_id = this.abscissa;
- var modes = ["list", "form", "graph"];
- var views = [];
- _.each(modes, function(mode) {
- var view = [false, mode];
- if (self.fields.views && self.fields.views[mode]) {
- view.push(self.fields.views[mode]);
+ var views;
+ if (this.widget_parent.action) {
+ views = this.widget_parent.action.views;
+ if (!_(views).detect(function (view) {
+ return view[1] === 'list' })) {
+ views = [[false, 'list']].concat(views);
}
- views.push(view);
- });
+ } else {
+ views = _(["list", "form", "graph"]).map(function(mode) {
+ return [false, mode];
+ });
+ }
this.do_action({
- "res_model" : this.dataset.model,
- "domain" : [[record_id, '=', id], ['id','in',this.dataset.ids]],
- "views" : views,
- "type" : "ir.actions.act_window",
- "view_type" : "list",
- "view_mode" : "list"
+ res_model : this.dataset.model,
+ domain: [[this.abscissa, '=', id], ['id','in',this.dataset.ids]],
+ views: views,
+ type: "ir.actions.act_window",
+ flags: {default_view: 'list'}
});
},