From cd2a5a430416d99653228d0b2aa6100f0dfda788 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 21 Feb 2014 15:41:22 +0100 Subject: [PATCH 1/4] [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(); From 3979ec99db1596c981e2f74539bc33dcb4ec2bbe Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 21 Feb 2014 17:24:05 +0100 Subject: [PATCH 2/4] [web_export_view]: fixes unandled case in if else construct --- .../static/js/web_advanced_export.js | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/web_export_view/static/js/web_advanced_export.js b/web_export_view/static/js/web_advanced_export.js index cd6758c7..847ad2c6 100644 --- a/web_export_view/static/js/web_advanced_export.js +++ b/web_export_view/static/js/web_advanced_export.js @@ -92,20 +92,24 @@ openerp.web_export_view = function(openerp) { $.each(rows,function(){ $row = $(this); // find only rows with data - if($row.attr('data-id')){ - export_row = []; + if($row.attr('data-id')){ + export_row = []; $.each(export_columns_keys,function(){ cell = $row.find('td[data-field="'+this+'"]').get(0); 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"); - } - } + if(data_id.find('input').get(0).type == 'checkbox'){ + if(data_id.find('input').get(0).checked){ + text = _t("True"); + } + else { + text = _t("False"); + } + } + else { + text = cell.text || cell.textContent || cell.innerHTML || ""; + } + } else{ text = cell.text || cell.textContent || cell.innerHTML || ""; } From f8ea01b0bd6fb96f7701ce97b9d0eca9b7c7fa8a Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 26 Feb 2014 11:40:11 +0100 Subject: [PATCH 3/4] [web_export_view]: localization template added --- web_export_view/i18n/web_export_view.pot | 82 ++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 web_export_view/i18n/web_export_view.pot diff --git a/web_export_view/i18n/web_export_view.pot b/web_export_view/i18n/web_export_view.pot new file mode 100644 index 00000000..f639fe7a --- /dev/null +++ b/web_export_view/i18n/web_export_view.pot @@ -0,0 +1,82 @@ +# Translations template for PROJECT. +# Copyright (C) 2014 ORGANIZATION +# This file is distributed under the same license as the PROJECT project. +# FIRST AUTHOR , 2014. +# +msgid "" +msgstr "" +"Project-Id-Version: PROJECT VERSION\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2014-02-21 18:59+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 0.9.6\n" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/js/web_advanced_export.js:103 +#, python-format +msgid "True" +msgstr "" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/js/web_advanced_export.js:106 +#, python-format +msgid "False" +msgstr "" + +I have seen that there is no current pot file, so these are the other entries you need for the full translation of the module: + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/js/web_advanced_export.js:38 +#, python-format +msgid "Customize" +msgstr "" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/js/web_advanced_export.js:40 +#, python-format +msgid "Translate" +msgstr "" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/js/web_advanced_export.js:42 +#, python-format +msgid "Technical translation" +msgstr "" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/js/web_advanced_export.js:46 +#, python-format +msgid "Other Options" +msgstr "" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/js/web_advanced_export.js:49 +#, python-format +msgid "Import" +msgstr "" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/js/web_advanced_export.js:52 +#, python-format +msgid "Export" +msgstr "" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/js/web_advanced_export.js:56 +#, python-format +msgid "Export current view" +msgstr "" From 4379d8ad88848ad83a2d4a8dcff8297d86113654 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 28 Feb 2014 13:53:26 +0100 Subject: [PATCH 4/4] [web_export_view] misprint deleted in localization pot file --- web_export_view/i18n/web_export_view.pot | 2 -- 1 file changed, 2 deletions(-) diff --git a/web_export_view/i18n/web_export_view.pot b/web_export_view/i18n/web_export_view.pot index f639fe7a..c2a28e13 100644 --- a/web_export_view/i18n/web_export_view.pot +++ b/web_export_view/i18n/web_export_view.pot @@ -30,8 +30,6 @@ msgstr "" msgid "False" msgstr "" -I have seen that there is no current pot file, so these are the other entries you need for the full translation of the module: - #. module: web_export_view #. openerp-web #: code:addons/web_export_view/static/src/js/web_advanced_export.js:38