Browse Source

Merge pull request #1083 from hbrunn/8.0-web_export_view-dont_fail_without_parent

[FIX] don't fail if there's no parent (any more)
pull/1093/head
Pedro M. Baeza 6 years ago
committed by GitHub
parent
commit
55193f4151
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  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({ instance.web.Sidebar.include({
redraw: function () { redraw: function () {
var self = this, var self = this,
view_manager = self.getParent().ViewManager,
view_manager = self.getParent() && self.getParent().ViewManager,
view_name = view_manager && view_manager.active_view, view_name = view_manager && view_manager.active_view,
active_view = view_name && view_manager.views[view_name]; active_view = view_name && view_manager.views[view_name];
this._super.apply(this, arguments); 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').append(QWeb.render('AddExportViewMain', {widget: self}));
self.$el.find('.oe_sidebar_export_view_xls').on('click', self.on_sidebar_export_view_xls); self.$el.find('.oe_sidebar_export_view_xls').on('click', self.on_sidebar_export_view_xls);
} }

Loading…
Cancel
Save