diff options
Diffstat (limited to 'addons/web_process/static/src/js/process.js')
| -rw-r--r-- | addons/web_process/static/src/js/process.js | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/addons/web_process/static/src/js/process.js b/addons/web_process/static/src/js/process.js index 8d4396ba403..601973d4cb5 100644 --- a/addons/web_process/static/src/js/process.js +++ b/addons/web_process/static/src/js/process.js @@ -28,8 +28,7 @@ openerp.web_process = function (openerp) { }, initialize_process_view: function() { var self = this; - $.when(this.fields_get(), this.help(), this.get_process_object()).pipe(function(fields, help, process) { - self.process_fields = fields; + $.when(this.help(), this.get_process_object()).pipe(function(help, process) { self.process_help = help; if(process && process.length) { if(process.length > 1) { @@ -46,9 +45,9 @@ openerp.web_process = function (openerp) { self.graph_get().done(function(res) { self.process_notes = res.notes; self.process_title = res.name; - self.process_subflows = _.filter(res.nodes, function(x) { - return x.subflow != false; - }); + self.process_subflows = _(res.nodes).chain() + .filter(function (node) { return node['subflow'] !== false; }) + .uniq(false, function (node) { return node['subflow'][0]; }).value(); self.process_related = res.related; def.resolve(res); }); @@ -78,17 +77,6 @@ openerp.web_process = function (openerp) { }); return def.promise(); }, - fields_get : function() { - var self = this, - def = $.Deferred(), - dataset = new openerp.web.DataSetStatic(this, this.model || this.dataset.model, this.session.context); - dataset - .call('fields_get',[]) - .done(function(fields) { - def.resolve(fields); - }).fail(def.reject); - return def.promise(); - }, help : function() { var self = this, def = $.Deferred(); @@ -145,11 +133,6 @@ openerp.web_process = function (openerp) { self.initialize_process_view(); }); - this.$element.find(".toggle_fields").click(function() { - $(this).children().toggle(); - self.$element.find('.process_fields').toggle(); - }); - this.$element.find(".process_subflow").click(function() { self.process_id = this.id; self.initialize_process_view(); @@ -286,7 +269,7 @@ openerp.web_process = function (openerp) { $(this).dialog('destroy'); }} ] - }).start().open(); + }).open(); action_manager.appendTo(dialog.$element); action_manager.do_action({ |
