diff options
| author | Vaibhav (OpenERP) <vda@tinyerp.com> | 2012-01-30 16:45:41 +0530 |
|---|---|---|
| committer | Vaibhav (OpenERP) <vda@tinyerp.com> | 2012-01-30 16:45:41 +0530 |
| commit | b4e7377b540684ad793205b5580420b7f5c1de8d (patch) | |
| tree | a9422f008c018f828302f9a2e576e5b3163b0fda /addons/web_process/static/src/js | |
| parent | b50afe59fb1f606d34546846de38144a3405de85 (diff) | |
[FIX] state of current process.
lp bug: https://launchpad.net/bugs/919175 fixed
bzr revid: vda@tinyerp.com-20120130111541-6mpeb9253fzzk46c
Diffstat (limited to 'addons/web_process/static/src/js')
| -rw-r--r-- | addons/web_process/static/src/js/process.js | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/addons/web_process/static/src/js/process.js b/addons/web_process/static/src/js/process.js index 150db955cf3..fb745689a3c 100644 --- a/addons/web_process/static/src/js/process.js +++ b/addons/web_process/static/src/js/process.js @@ -28,6 +28,11 @@ openerp.web_process = function (openerp) { }, initialize_process_view: function() { var self = this; + this.record_id = false; + if(this.active_view == 'page' || this.active_view == 'form') { + this.record_id = this.views[this.active_view].controller.datarecord.id; + } + $.when(this.help(), this.get_process_object()).pipe(function(help, process) { self.process_help = help; if(process && process.length) { @@ -65,7 +70,7 @@ openerp.web_process = function (openerp) { this.process_id = parseInt(this.process_id, 10); this.process_dataset - .call("graph_get",[this.process_id, this.model || this.dataset.model, false, [80,80,150,100]]) + .call("graph_get",[this.process_id, this.model || this.dataset.model, this.record_id, [80,80,150,100]]) .done(function(res) { self.process_dataset .call("search_by_model",[self.model || self.dataset.model,self.session.context]) @@ -194,6 +199,10 @@ openerp.web_process = function (openerp) { to += from; } } + + if(n.node.res) + new_notes = n.node.res.name + '\n' + new_notes; + process_node_desc = r.text(n.node.x+85, n.node.y+50, (new_notes)); r['image']('/web/static/src/img/icons/gtk-info.png', n.node.x+20, n.node.y+70, 16, 16) .attr({"cursor": "pointer", "title": "Help"}) @@ -220,7 +229,7 @@ openerp.web_process = function (openerp) { node['res_model'] = self.model, node['res_id'] = false, node['id'] = node_id; - process_graph.addNode(node['name'], {node: node,render: process_renderer}); + process_graph.addNode(node.id, {node: node,render: process_renderer}); }); _.each(res['transitions'], function(transitions) { @@ -228,7 +237,7 @@ openerp.web_process = function (openerp) { var dst = res['nodes'][transitions['target']]; // make active transitions['active'] = src.active && !dst.gray; - process_graph.addEdge(src['name'], dst['name'], {directed : true}); + process_graph.addEdge(src.id, dst.id, {directed : true}); }); var width = $(document).width(); var height = $(document).height(); |
