diff --git a/web_export_view/__openerp__.py b/web_export_view/__openerp__.py index 4b029c46..5820dc91 100644 --- a/web_export_view/__openerp__.py +++ b/web_export_view/__openerp__.py @@ -21,7 +21,7 @@ { 'name': 'Export Current View', - 'version': '8.0.1.2.0', + 'version': '8.0.1.3.0', 'category': 'Web', 'author': "Agile Business Group,Odoo Community Association (OCA)", 'website': 'http://www.agilebg.com', diff --git a/web_export_view/static/src/js/web_export_view.js b/web_export_view/static/src/js/web_export_view.js index 00cb047e..2bd05661 100644 --- a/web_export_view/static/src/js/web_export_view.js +++ b/web_export_view/static/src/js/web_export_view.js @@ -32,12 +32,13 @@ openerp.web_export_view = function (instance) { } }, - on_sidebar_export_view_xls: function () { + on_sidebar_export_view_xls: function (e, active_domain) { // Select the first list of the current (form) view // or assume the main view is a list view and use that var self = this, view = this.getParent(), - children = view.getChildren(); + children = view.getChildren(), + deferred = new jQuery.Deferred(); if (children) { children.every(function (child) { if (child.field && child.field.type == 'one2many') { @@ -60,56 +61,47 @@ openerp.web_export_view = function (instance) { export_columns_names.push(this.string); } }); - rows = view.$el.find('.oe_list_content > tbody > tr'); - export_rows = []; - $.each(rows, function () { - $row = $(this); - // find only rows with data - if ($row.attr('data-id')) { - export_row = []; - checked = $row.find('th input[type=checkbox]').attr("checked"); - if (children && checked === "checked") { - $.each(export_columns_keys, function () { - cell = $row.find('td[data-field="' + this + '"]').get(0); - text = cell.text || cell.textContent || cell.innerHTML || ""; - if (cell.classList.contains("oe_list_field_float")) { - export_row.push(instance.web.parse_value(text, {'type': "float"})); - } - else if (cell.classList.contains("oe_list_field_boolean")) { - var data_id = $('