Raphael Collet (OpenERP) has proposed merging 
lp:~openerp-dev/openerp-web/trunk-v62_config into lp:openerp-web.

Requested reviews:
  OpenERP R&D Web Team (openerp-dev-web)
  Raphael Collet (OpenERP) (rco-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-v62_config/+merge/105814

Add a client action 'reload' to refresh completely the client.
It is used by configuration wizards once they are applied.
It can optionally open a given menu_id.

-- 
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-v62_config/+merge/105814
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openerp-web/trunk-v62_config.
=== modified file 'addons/web/static/src/js/views.js'
--- addons/web/static/src/js/views.js	2012-05-10 17:54:35 +0000
+++ addons/web/static/src/js/views.js	2012-05-15 13:38:28 +0000
@@ -1267,6 +1267,28 @@
 instance.web.client_actions = new instance.web.Registry();
 
 /**
+ * Client action to reload the whole interface.
+ * If params has an entry 'menu_id', it opens the given menu entry.
+ */
+instance.web.client_actions.add("reload", "instance.web.Reload");
+
+instance.web.Reload = instance.web.Widget.extend({
+    init: function(parent, params) {
+        this._super(parent);
+        this.menu_id = (params && params.menu_id) || false;
+    },
+    start: function() {
+        if (this.menu_id) {
+            // open the given menu id
+            var url_without_fragment = window.location.toString().split("#", 1)[0];
+            window.location = url_without_fragment + "#menu_id=" + this.menu_id;
+        } else {
+            window.location.reload();
+        }
+    }
+});
+
+/**
  * Registry for all the main views
  */
 instance.web.views = new instance.web.Registry();

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to