From 848b457995fc2c40c1287b3b4e21bd559b79e1e1 Mon Sep 17 00:00:00 2001 From: Guewen Baconnier Date: Fri, 6 Dec 2013 14:05:24 +0100 Subject: [PATCH] [FIX] error when a view has no sidebar (popup) --- .../static/src/js/web_translate_dialog.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/web_translate_dialog/static/src/js/web_translate_dialog.js b/web_translate_dialog/static/src/js/web_translate_dialog.js index bdb7d07c..124464fa 100644 --- a/web_translate_dialog/static/src/js/web_translate_dialog.js +++ b/web_translate_dialog/static/src/js/web_translate_dialog.js @@ -10,9 +10,11 @@ openerp.web_translate_dialog = function (instance) { load_form: function(data) { var self = this; this._super(data); - this.sidebar.add_items('other', _.compact([ - self.is_action_enabled('edit') && { label: _t('Translate'), callback: self.on_button_translate }, - ])); + if (this.sidebar) { + this.sidebar.add_items('other', _.compact([ + self.is_action_enabled('edit') && { label: _t('Translate'), callback: self.on_button_translate }, + ])); + } }, on_button_translate: function() { var self = this; @@ -199,4 +201,3 @@ openerp.web_translate_dialog = function (instance) { }, }); }; -