X-Git-Url: http://git.inspyration.org/?a=blobdiff_plain;f=addons%2Fweb%2Fstatic%2Fsrc%2Fjs%2Fviews.js;h=fd080c8db56c3a3ec2db42ec56a328360d1dc5a6;hb=7c87017fc2a6f0061090ab874fddc3de1f421e0f;hp=168318dd9defef109804e8809262c94579f4dba8;hpb=1840e0a2b7cb6a6f57ebd18d4c68b8d06dfafdb9;p=odoo%2Fodoo.git diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 168318d..fd080c8 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -364,9 +364,9 @@ session.web.ViewManager = session.web.OldWidget.extend(/** @lends session.web.V * @returns {$.Deferred} switching end signal */ on_prev_view: function (options) { + options = options || {}; var current_view = this.views_history.pop(); var previous_view = this.views_history[this.views_history.length - 1] || options['default']; - if (options != undefined) { if (options.created && current_view === 'form' && previous_view === 'list') { // APR special case: "If creation mode from list (and only from a list), // after saving, go to page view (don't come back in list)" @@ -374,7 +374,7 @@ session.web.ViewManager = session.web.OldWidget.extend(/** @lends session.web.V } else if (options.created && !previous_view && this.action && this.action.flags.default_view === 'form') { // APR special case: "If creation from dashboard, we have no previous view return this.on_mode_switch('page'); - }} + } return this.on_mode_switch(previous_view, true); }, /** @@ -963,8 +963,8 @@ session.web.TranslateDialog = session.web.Dialog.extend({ // TODO fme: should add the language to fields_view_get because between the fields view get // and the moment the user opens the translation dialog, the user language could have been changed this.view_language = view.session.user_context.lang; - this['on_button' + _t("Save")] = this.on_button_Save; - this['on_button' + _t("Close")] = this.on_button_Close; + this['on_button_' + _t("Save")] = this.on_btn_save; + this['on_button_' + _t("Close")] = this.on_btn_close; this._super(view, { width: '80%', height: '80%' @@ -1045,7 +1045,7 @@ session.web.TranslateDialog = session.web.Dialog.extend({ } }); }, - on_button_Save: function() { + on_btn_save: function() { var trads = {}, self = this, trads_mutex = new $.Mutex(); @@ -1068,7 +1068,7 @@ session.web.TranslateDialog = session.web.Dialog.extend({ }); this.close(); }, - on_button_Close: function() { + on_btn_close: function() { this.close(); } });