From a90423f771a9a63cd5b13412a5e3b8480adcfa70 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Wed, 8 Aug 2012 21:07:08 +0200 Subject: [PATCH] [IMP] user preferences is a regular wizard bzr revid: al@openerp.com-20120808190708-1u9bxnun5cwijq8l --- addons/web/static/src/js/chrome.js | 40 +++--------------------------- 1 file changed, 3 insertions(+), 37 deletions(-) diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 349817780cd..7c8c740691b 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -886,44 +886,10 @@ instance.web.UserMenu = instance.web.Widget.extend({ }, on_menu_settings: function() { var self = this; - var action_manager = new instance.web.ActionManager(this); - var dataset = new instance.web.DataSet (this,'res.users',this.context); - dataset.call ('action_get','',function (result){ - self.rpc('/web/action/load', {action_id:result}, function(result){ - action_manager.do_action(_.extend(result['result'], { - target: 'inline', - res_id: self.session.uid, - res_model: 'res.users', - flags: { - action_buttons: false, - search_view: false, - sidebar: false, - views_switcher: false, - pager: false - } - })); - }); + self.rpc("/web/action/load", { action_id: "base.action_res_users_my" }, function(result) { + result.result.res_id = instance.connection.uid; + self.getParent().action_manager.do_action(result.result); }); - this.dialog = new instance.web.Dialog(this,{ - title: _t("Preferences"), - width: '700px', - buttons: [ - {text: _t("Change password"), click: function(){ self.change_password(); }}, - {text: _t("Cancel"), click: function(){ $(this).dialog('destroy'); }}, - {text: _t("Save"), click: function(){ - var inner_widget = action_manager.inner_widget; - inner_widget.views[inner_widget.active_view].controller.do_save() - .then(function() { - self.dialog.destroy(); - // needs to refresh interface in case language changed - window.location.reload(); - }); - } - } - ] - }).open(); - action_manager.appendTo(this.dialog.$element); - action_manager.renderElement(this.dialog); }, on_menu_about: function() { var self = this;