From cd2a5a430416d99653228d0b2aa6100f0dfda788 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 21 Feb 2014 15:41:22 +0100 Subject: [PATCH] [web_export_view]: Adds support to export boolean fields values --- .../static/js/web_advanced_export.js | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/web_export_view/static/js/web_advanced_export.js b/web_export_view/static/js/web_advanced_export.js index 4e03762c..cd6758c7 100644 --- a/web_export_view/static/js/web_advanced_export.js +++ b/web_export_view/static/js/web_advanced_export.js @@ -89,17 +89,29 @@ openerp.web_export_view = function(openerp) { }); rows = view.$element.find('.ui-widget-content tr'); export_rows = []; - $.each(rows,function(){ + $.each(rows,function(){ $row = $(this); - // find only rows with data - if($row.attr('data-id')){ - export_row = []; + // find only rows with data + if($row.attr('data-id')){ + export_row = []; $.each(export_columns_keys,function(){ cell = $row.find('td[data-field="'+this+'"]').get(0); - text = cell.text || cell.textContent || cell.innerHTML || ""; - export_row.push(text.trim()); + var data_id = $( '
' + cell.innerHTML + '
'); + if(data_id.find('input').get(0) != undefined) { + if(data_id.find('input').get(0).type == 'checkbox' && + data_id.find('input').get(0).checked){ + text = _t("True"); + } + else { + text = _t("False"); + } + } + else{ + text = cell.text || cell.textContent || cell.innerHTML || ""; + } + export_row.push(text.trim()); }); - export_rows.push(export_row); + export_rows.push(export_row); } }); $.blockUI();