From 564c9066fa8520c9363f7607151b285deff88519 Mon Sep 17 00:00:00 2001 From: "RGA(OpenERP)" <> Date: Mon, 15 Oct 2012 17:22:14 +0530 Subject: [PATCH 1/2] [FIX] diagram view record not reload on refresh bzr revid: rgaopenerp-20121015115214-cdw5ca6d24fgakir --- addons/web_diagram/static/src/js/diagram.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/addons/web_diagram/static/src/js/diagram.js b/addons/web_diagram/static/src/js/diagram.js index 4bae1aed3db..9617bdbafb3 100644 --- a/addons/web_diagram/static/src/js/diagram.js +++ b/addons/web_diagram/static/src/js/diagram.js @@ -116,9 +116,20 @@ instance.web.DiagramView = instance.web.View.extend({ if(id_record) { this.id = id_record; this.get_diagram_info(); + this.do_push_state({id:record.id}); } }, + do_load_state: function(state, warm) { + if (state && !this.dataset.get_id_index(state.id)) { + this.dataset.ids.push(state.id); + } + this.dataset.select_id(state.id); + if (warm) { + this.do_show(); + } + }, + // Set-up the drawing elements of the diagram draw_diagram: function(result) { var self = this; From b8ba7b389c1e477e9b2970099390e42428a82a42 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Mon, 22 Oct 2012 10:35:38 +0200 Subject: [PATCH 2/2] [IMP] Improved state in diagram bzr revid: fme@openerp.com-20121022083538-ua6fq20x5qkdwcwy --- addons/web_diagram/static/src/js/diagram.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/addons/web_diagram/static/src/js/diagram.js b/addons/web_diagram/static/src/js/diagram.js index 9617bdbafb3..2e0e5881378 100644 --- a/addons/web_diagram/static/src/js/diagram.js +++ b/addons/web_diagram/static/src/js/diagram.js @@ -113,20 +113,24 @@ instance.web.DiagramView = instance.web.View.extend({ on_diagram_loaded: function(record) { var id_record = record['id']; - if(id_record) { + if (id_record) { this.id = id_record; this.get_diagram_info(); - this.do_push_state({id:record.id}); + this.do_push_state({id: id_record}); + } else { + this.do_push_state({}); } }, do_load_state: function(state, warm) { - if (state && !this.dataset.get_id_index(state.id)) { - this.dataset.ids.push(state.id); - } - this.dataset.select_id(state.id); - if (warm) { - this.do_show(); + if (state && state.id) { + if (!this.dataset.get_id_index(state.id)) { + this.dataset.ids.push(state.id); + } + this.dataset.select_id(state.id); + if (warm) { + this.do_show(); + } } },