Browse Source

[FIX] don't fail if there's no parent (any more)

pull/1083/head
Holger Brunn 6 years ago
parent
commit
acce638fb0
No known key found for this signature in database GPG Key ID: 1C9760FECA3AE18
  1. 4
      web_export_view/static/src/js/web_export_view.js

4
web_export_view/static/src/js/web_export_view.js

@ -25,11 +25,11 @@ openerp.web_export_view = function (instance) {
instance.web.Sidebar.include({
redraw: function () {
var self = this,
view_manager = self.getParent().ViewManager,
view_manager = self.getParent() && self.getParent().ViewManager,
view_name = view_manager && view_manager.active_view,
active_view = view_name && view_manager.views[view_name];
this._super.apply(this, arguments);
if (active_view.controller instanceof instance.web.ListView) {
if (active_view && active_view.controller instanceof instance.web.ListView) {
self.$el.find('.oe_sidebar').append(QWeb.render('AddExportViewMain', {widget: self}));
self.$el.find('.oe_sidebar_export_view_xls').on('click', self.on_sidebar_export_view_xls);
}

Loading…
Cancel
Save