From 5517ab86d66b21b6d00e7ff2d62aa885e3ae6ed5 Mon Sep 17 00:00:00 2001 From: Leonardo Pistone Date: Tue, 4 Jun 2013 09:29:47 +0200 Subject: [PATCH 01/32] [add] module web_export_view copied from 6.1 --- web_export_view/.DS_Store | Bin 0 -> 6148 bytes web_export_view/AUTHORS.txt | 6 + web_export_view/__init__.py | 21 ++++ web_export_view/__openerp__.py | 53 ++++++++ web_export_view/controllers.py | 46 +++++++ .../static/js/web_advanced_export.js | 116 ++++++++++++++++++ 6 files changed, 242 insertions(+) create mode 100644 web_export_view/.DS_Store create mode 100644 web_export_view/AUTHORS.txt create mode 100644 web_export_view/__init__.py create mode 100644 web_export_view/__openerp__.py create mode 100644 web_export_view/controllers.py create mode 100644 web_export_view/static/js/web_advanced_export.js diff --git a/web_export_view/.DS_Store b/web_export_view/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 [simahawk] +Lorenzo Battistini +Stefan Rijnhart diff --git a/web_export_view/__init__.py b/web_export_view/__init__.py new file mode 100644 index 00000000..09691964 --- /dev/null +++ b/web_export_view/__init__.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2012 Agile Business Group sagl () +# Copyright (C) 2012 Domsense srl () +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## +import controllers diff --git a/web_export_view/__openerp__.py b/web_export_view/__openerp__.py new file mode 100644 index 00000000..41008b3d --- /dev/null +++ b/web_export_view/__openerp__.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2012 Domsense srl () +# Copyright (C) 2012-2013 Agile Business Group sagl +# () +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +{ + 'name': 'Export Current View', + 'version': '1.0', + 'category': 'Web', + 'description': """ +WEB EXPORT VIEW +=============== + +One of the best OpenERP’s features is exporting custom data to CSV/XLS. You can do it by clicking on the export link in the sidebar. The export action allows use to configure what to be exported by selecting fields, etc, and allows you to save your export as a template so that you can export it once again without having to configure it again. + +That feature is as great and advanced as limited for an everyday-customer-experience. A lot of customers want simply to export the tree view they are looking to. + +If you miss this feature as us, probably you’ll find an answer into our web_export_view module. + +After you installed it, you’ll find an additional link ‘Export current view’ right below the ‘Export’ one. By clicking on it you’ll get a XLS file contains the same data of the tree view you are looking at, headers included. +""", + 'author': 'Agile Business Group', + 'website': 'http://www.agilebg.com', + 'license': 'AGPL-3', + 'depends': ['web'], + 'external_dependencies' : { + 'python' : ['xlwt'], + }, + 'data': [], + 'active': False, + 'auto_install': False, + 'js': [ + 'static/js/web_advanced_export.js', + ], +} + diff --git a/web_export_view/controllers.py b/web_export_view/controllers.py new file mode 100644 index 00000000..ba7f4e1d --- /dev/null +++ b/web_export_view/controllers.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2012 Agile Business Group sagl () +# Copyright (C) 2012 Domsense srl () +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## +try: + import json +except ImportError: + import simplejson as json + +import web.common.http as openerpweb + +from web.controllers.main import ExcelExport + + +class ExcelExportView(ExcelExport): + _cp_path = '/web/export/xls_view' + + @openerpweb.httprequest + def index(self, req, data, token): + data = json.loads(data) + model = data.get('model',[]) + columns_headers = data.get('headers',[]) + rows = data.get('rows',[]) + + context = req.session.eval_context(req.context) + + return req.make_response(self.from_data(columns_headers, rows), + headers=[('Content-Disposition', 'attachment; filename="%s"' % self.filename(model)), + ('Content-Type', self.content_type)], + cookies={'fileToken': int(token)}) diff --git a/web_export_view/static/js/web_advanced_export.js b/web_export_view/static/js/web_advanced_export.js new file mode 100644 index 00000000..0c26f48b --- /dev/null +++ b/web_export_view/static/js/web_advanced_export.js @@ -0,0 +1,116 @@ +// @@@ web_export_view custom JS @@@ +//############################################################################# +// +// Copyright (C) 2012 Agile Business Group sagl () +// Copyright (C) 2012 Therp BV () +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . +// +//############################################################################# + +openerp.web_export_view = function(openerp) { + + _t = openerp.web._t; + + openerp.web.Sidebar = openerp.web.Sidebar.extend({ + + add_default_sections: function() { + // IMHO sections should be registered objects + // as views and retrieved using a specific registry + // so that we don't have to override this + + var self = this, + view = this.widget_parent, + view_manager = view.widget_parent, + action = view_manager.action; + if (this.session.uid === 1) { + this.add_section(_t('Customize'), 'customize'); + this.add_items('customize', [{ + label: _t("Translate"), + callback: view.on_sidebar_translate, + title: _t("Technical translation") + }]); + } + + this.add_section(_t('Other Options'), 'other'); + this.add_items('other', [ + { + label: _t("Export"), + callback: view.on_sidebar_export + }, + { + label: _t("Export current view"), + callback: this.on_sidebar_export_view + } + ]); + }, + + on_sidebar_export_view: function() { + // 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.widget_parent; // valid for list view + if (view.widget_children) { + view.widget_children.every(function(child) { + if (child.field && child.field.type == 'one2many') { + view = child.viewmanager.views.list.controller; + return false; // break out of the loop + } + if (child.field && child.field.type == 'many2many') { + view = child.list_view; + return false; // break out of the loop + } + return true; + }); + } + var columns = view.visible_columns; + export_columns_keys = []; + export_columns_names = []; + $.each(columns,function(){ + if(this.tag=='field'){ + // non-fields like `_group` or buttons + export_columns_keys.push(this.id); + export_columns_names.push(this.string); + } + }); + rows = view.$element.find('.ui-widget-content tr'); + export_rows = []; + $.each(rows,function(){ + $row = $(this); + // 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()); + }); + export_rows.push(export_row); + } + }); + $.blockUI(); + view.session.get_file({ + url: '/web/export/xls_view', + data: {data: JSON.stringify({ + model : view.model, + headers : export_columns_names, + rows : export_rows, + })}, + complete: $.unblockUI + }); + }, + + }); + +} From acda8a15289dd075d6ff01bd72a0f97609c0b911 Mon Sep 17 00:00:00 2001 From: Leonardo Pistone Date: Tue, 4 Jun 2013 11:06:55 +0200 Subject: [PATCH 02/32] [add] port web_export_view to OpenERP 7 --- web_export_view/.DS_Store | Bin 6148 -> 0 bytes web_export_view/AUTHORS.txt | 1 + web_export_view/__openerp__.py | 36 ++++++---- web_export_view/controllers.py | 25 ++++--- .../static/js/web_advanced_export.js | 67 ++++++------------ .../static/xml/web_advanced_export.xml | 13 ++++ 6 files changed, 72 insertions(+), 70 deletions(-) delete mode 100644 web_export_view/.DS_Store create mode 100644 web_export_view/static/xml/web_advanced_export.xml diff --git a/web_export_view/.DS_Store b/web_export_view/.DS_Store deleted file mode 100644 index 5008ddfcf53c02e82d7eee2e57c38e5672ef89f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 [simahawk] Lorenzo Battistini Stefan Rijnhart +Leonardo Pistone diff --git a/web_export_view/__openerp__.py b/web_export_view/__openerp__.py index 41008b3d..555f9b27 100644 --- a/web_export_view/__openerp__.py +++ b/web_export_view/__openerp__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # Copyright (C) 2012 Domsense srl () # Copyright (C) 2012-2013 Agile Business Group sagl # () @@ -22,32 +22,38 @@ { 'name': 'Export Current View', - 'version': '1.0', + 'version': '1.1', 'category': 'Web', 'description': """ WEB EXPORT VIEW =============== -One of the best OpenERP’s features is exporting custom data to CSV/XLS. You can do it by clicking on the export link in the sidebar. The export action allows use to configure what to be exported by selecting fields, etc, and allows you to save your export as a template so that you can export it once again without having to configure it again. +One of the best OpenERP’s features is exporting custom data to CSV/XLS. You can +do it by clicking on the export link in the sidebar. The export action allows +use to configure what to be exported by selecting fields, etc, and allows you +to save your export as a template so that you can export it once again without +having to configure it again. -That feature is as great and advanced as limited for an everyday-customer-experience. A lot of customers want simply to export the tree view they are looking to. +That feature is as great and advanced as limited for an everyday experience. +A lot of customers want simply to export the tree view they are looking to. -If you miss this feature as us, probably you’ll find an answer into our web_export_view module. +If you miss this feature as us, probably you’ll find an answer into our +web_export_view module. -After you installed it, you’ll find an additional link ‘Export current view’ right below the ‘Export’ one. By clicking on it you’ll get a XLS file contains the same data of the tree view you are looking at, headers included. +After you installed it, you’ll find an additional link ‘Export current view’ +right below the ‘Export’ one. By clicking on it you’ll get a XLS file contains +the same data of the tree view you are looking at, headers included. """, 'author': 'Agile Business Group', 'website': 'http://www.agilebg.com', 'license': 'AGPL-3', 'depends': ['web'], - 'external_dependencies' : { - 'python' : ['xlwt'], - }, - 'data': [], - 'active': False, + # 'external_dependencies': { + # 'python': ['xlwt'], + # }, + 'js': ['static/*/*.js', 'static/*/js/*.js'], + 'qweb': ['static/xml/web_advanced_export.xml'], + 'installable': True, 'auto_install': False, - 'js': [ - 'static/js/web_advanced_export.js', - ], + 'web_preload': False, } - diff --git a/web_export_view/controllers.py b/web_export_view/controllers.py index ba7f4e1d..dc225ee2 100644 --- a/web_export_view/controllers.py +++ b/web_export_view/controllers.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # Copyright (C) 2012 Agile Business Group sagl () # Copyright (C) 2012 Domsense srl () # @@ -23,7 +23,7 @@ try: except ImportError: import simplejson as json -import web.common.http as openerpweb +import web.http as openerpweb from web.controllers.main import ExcelExport @@ -34,13 +34,16 @@ class ExcelExportView(ExcelExport): @openerpweb.httprequest def index(self, req, data, token): data = json.loads(data) - model = data.get('model',[]) - columns_headers = data.get('headers',[]) - rows = data.get('rows',[]) - - context = req.session.eval_context(req.context) + model = data.get('model', []) + columns_headers = data.get('headers', []) + rows = data.get('rows', []) - return req.make_response(self.from_data(columns_headers, rows), - headers=[('Content-Disposition', 'attachment; filename="%s"' % self.filename(model)), - ('Content-Type', self.content_type)], - cookies={'fileToken': int(token)}) + return req.make_response( + self.from_data(columns_headers, rows), + headers=[ + ('Content-Disposition', 'attachment; filename="%s"' + % self.filename(model)), + ('Content-Type', self.content_type) + ], + cookies={'fileToken': int(token)} + ) diff --git a/web_export_view/static/js/web_advanced_export.js b/web_export_view/static/js/web_advanced_export.js index 0c26f48b..03e05bdd 100644 --- a/web_export_view/static/js/web_advanced_export.js +++ b/web_export_view/static/js/web_advanced_export.js @@ -19,48 +19,25 @@ // //############################################################################# -openerp.web_export_view = function(openerp) { +openerp.web_export_view = function(instance, m) { - _t = openerp.web._t; + var _t = instance.web._t, + QWeb = instance.web.qweb; - openerp.web.Sidebar = openerp.web.Sidebar.extend({ - - add_default_sections: function() { - // IMHO sections should be registered objects - // as views and retrieved using a specific registry - // so that we don't have to override this - - var self = this, - view = this.widget_parent, - view_manager = view.widget_parent, - action = view_manager.action; - if (this.session.uid === 1) { - this.add_section(_t('Customize'), 'customize'); - this.add_items('customize', [{ - label: _t("Translate"), - callback: view.on_sidebar_translate, - title: _t("Technical translation") - }]); - } - - this.add_section(_t('Other Options'), 'other'); - this.add_items('other', [ - { - label: _t("Export"), - callback: view.on_sidebar_export - }, - { - label: _t("Export current view"), - callback: this.on_sidebar_export_view - } - ]); + instance.web.Sidebar.include({ + redraw: function() { + var self = this; + this._super.apply(this, arguments); + 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); }, - on_sidebar_export_view: function() { + on_sidebar_export_view_xls: function() { // 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.widget_parent; // valid for list view + view = this.getParent(), + columns = view.visible_columns; if (view.widget_children) { view.widget_children.every(function(child) { if (child.field && child.field.type == 'one2many') { @@ -74,7 +51,6 @@ openerp.web_export_view = function(openerp) { return true; }); } - var columns = view.visible_columns; export_columns_keys = []; export_columns_names = []; $.each(columns,function(){ @@ -84,19 +60,22 @@ openerp.web_export_view = function(openerp) { export_columns_names.push(this.string); } }); - rows = view.$element.find('.ui-widget-content tr'); + 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 = []; - $.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()); - }); - export_rows.push(export_row); + checked = $row.find('th input[type=checkbox]').attr("checked"); + if (checked === "checked"){ + $.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()); + }); + export_rows.push(export_row); + } } }); $.blockUI(); @@ -113,4 +92,4 @@ openerp.web_export_view = function(openerp) { }); -} +}; diff --git a/web_export_view/static/xml/web_advanced_export.xml b/web_export_view/static/xml/web_advanced_export.xml new file mode 100644 index 00000000..cb4b5004 --- /dev/null +++ b/web_export_view/static/xml/web_advanced_export.xml @@ -0,0 +1,13 @@ + + + + +
+ +
    +
  • Excel
  • +
+
+
+
From 7c22f40bd311360afabbe2190be0cc83bae34b03 Mon Sep 17 00:00:00 2001 From: Alex Comba Date: Wed, 19 Jun 2013 11:50:37 +0200 Subject: [PATCH 03/32] [FIX] Convert number string to number --- web_export_view/static/js/web_advanced_export.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/web_export_view/static/js/web_advanced_export.js b/web_export_view/static/js/web_advanced_export.js index 03e05bdd..75fb6873 100644 --- a/web_export_view/static/js/web_advanced_export.js +++ b/web_export_view/static/js/web_advanced_export.js @@ -72,10 +72,18 @@ openerp.web_export_view = function(instance, m) { $.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()); + if (cell.classList.contains("oe_list_field_float")){ + export_row.push(parseFloat(text)); + } + else if (cell.classList.contains("oe_list_field_integer")){ + export_row.push(parseInt(text)); + } + else{ + export_row.push(text.trim()); + } }); export_rows.push(export_row); - } + }; } }); $.blockUI(); From 255a5792dc0e5a841672a3ec1a23e1027605d179 Mon Sep 17 00:00:00 2001 From: Stefan Rijnhart Date: Tue, 23 Jul 2013 15:25:54 +0200 Subject: [PATCH 04/32] [FIX] web_export_view: Several things: * Compatibility with Werkzeug 0.9.3 * Export of first one2many field works again * Parsing of float values --- web_export_view/controllers.py | 2 +- web_export_view/static/js/web_advanced_export.js | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/web_export_view/controllers.py b/web_export_view/controllers.py index dc225ee2..89304e35 100644 --- a/web_export_view/controllers.py +++ b/web_export_view/controllers.py @@ -45,5 +45,5 @@ class ExcelExportView(ExcelExport): % self.filename(model)), ('Content-Type', self.content_type) ], - cookies={'fileToken': int(token)} + cookies={'fileToken': token} ) diff --git a/web_export_view/static/js/web_advanced_export.js b/web_export_view/static/js/web_advanced_export.js index 75fb6873..de13dfa1 100644 --- a/web_export_view/static/js/web_advanced_export.js +++ b/web_export_view/static/js/web_advanced_export.js @@ -37,9 +37,9 @@ openerp.web_export_view = function(instance, m) { // or assume the main view is a list view and use that var self = this, view = this.getParent(), - columns = view.visible_columns; - if (view.widget_children) { - view.widget_children.every(function(child) { + children = view.getChildren(); + if (children) { + children.every(function(child) { if (child.field && child.field.type == 'one2many') { view = child.viewmanager.views.list.controller; return false; // break out of the loop @@ -53,7 +53,7 @@ openerp.web_export_view = function(instance, m) { } export_columns_keys = []; export_columns_names = []; - $.each(columns,function(){ + $.each(view.visible_columns, function(){ if(this.tag=='field'){ // non-fields like `_group` or buttons export_columns_keys.push(this.id); @@ -68,12 +68,12 @@ openerp.web_export_view = function(instance, m) { if($row.attr('data-id')){ export_row = []; checked = $row.find('th input[type=checkbox]').attr("checked"); - if (checked === "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(parseFloat(text)); + export_row.push(instance.web.parse_value(text, {'type': "float"})); } else if (cell.classList.contains("oe_list_field_integer")){ export_row.push(parseInt(text)); From b02dba9a768f2c894bdd5ae735d2f14519cf7561 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Mon, 21 Oct 2013 13:57:07 +0200 Subject: [PATCH 05/32] [FIX] don't show export format for current view in export list --- web_export_view/controllers.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web_export_view/controllers.py b/web_export_view/controllers.py index 89304e35..01e3e1f9 100644 --- a/web_export_view/controllers.py +++ b/web_export_view/controllers.py @@ -31,6 +31,11 @@ from web.controllers.main import ExcelExport class ExcelExportView(ExcelExport): _cp_path = '/web/export/xls_view' + def __getattribute__(self, name): + if name == 'fmt': + raise AttributeError() + return super(ExcelExportView, self).__getattribute__(name) + @openerpweb.httprequest def index(self, req, data, token): data = json.loads(data) From 2bcdc4983950283f8b23b620de72b2a1feb25c6c Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Mon, 21 Oct 2013 14:37:21 +0200 Subject: [PATCH 06/32] [ADD] pot file + Dutch and German translation --- web_export_view/i18n/de.po | 29 ++++++++++++++++++++++++ web_export_view/i18n/nl.po | 29 ++++++++++++++++++++++++ web_export_view/i18n/web_export_view.pot | 29 ++++++++++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 web_export_view/i18n/de.po create mode 100644 web_export_view/i18n/nl.po create mode 100644 web_export_view/i18n/web_export_view.pot diff --git a/web_export_view/i18n/de.po b/web_export_view/i18n/de.po new file mode 100644 index 00000000..efb20b30 --- /dev/null +++ b/web_export_view/i18n/de.po @@ -0,0 +1,29 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2013-10-21 11:59+0000\n" +"PO-Revision-Date: 2013-10-21 11:59+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/xml/web_advanced_export.xml:7 +#, python-format +msgid "Export Current View" +msgstr "Aktuelle Liste exportieren" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/xml/web_advanced_export.xml:9 +#, python-format +msgid "Excel" +msgstr "Excel" diff --git a/web_export_view/i18n/nl.po b/web_export_view/i18n/nl.po new file mode 100644 index 00000000..96e86d5e --- /dev/null +++ b/web_export_view/i18n/nl.po @@ -0,0 +1,29 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2013-10-21 11:59+0000\n" +"PO-Revision-Date: 2013-10-21 11:59+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: web +#. openerp-web +#: code:addons/web_export_view/static/xml/web_advanced_export.xml:7 +#, python-format +msgid "Export Current View" +msgstr "Huidige lijst exporteren" + +#. module: web +#. openerp-web +#: code:addons/web_export_view/static/xml/web_advanced_export.xml:9 +#, python-format +msgid "Excel" +msgstr "Excel" 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..9adca17c --- /dev/null +++ b/web_export_view/i18n/web_export_view.pot @@ -0,0 +1,29 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2013-10-21 11:59+0000\n" +"PO-Revision-Date: 2013-10-21 11:59+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/xml/web_advanced_export.xml:7 +#, python-format +msgid "Export Current View" +msgstr "" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/xml/web_advanced_export.xml:9 +#, python-format +msgid "Excel" +msgstr "" From 2d32eeffb1133f118acdb7772283d5e5a2dbc4c5 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Tue, 18 Feb 2014 19:21:54 +0100 Subject: [PATCH 07/32] [ADD] Add FR translation for 'web_export_view' module --- web_export_view/i18n/fr.po | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 web_export_view/i18n/fr.po diff --git a/web_export_view/i18n/fr.po b/web_export_view/i18n/fr.po new file mode 100644 index 00000000..e3a43434 --- /dev/null +++ b/web_export_view/i18n/fr.po @@ -0,0 +1,29 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-02-18 18:17+0000\n" +"PO-Revision-Date: 2014-02-18 18:17+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/xml/web_advanced_export.xml:7 +#, python-format +msgid "Export Current View" +msgstr "Exporter la vue courrante" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/xml/web_advanced_export.xml:9 +#, python-format +msgid "Excel" +msgstr "Excel" From c6c107f35901a7eaa1a514a0d456a297ff4f903e Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Tue, 18 Feb 2014 20:14:42 +0100 Subject: [PATCH 08/32] [FIX] now export only selected items. --- web_export_view/static/js/web_advanced_export.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_export_view/static/js/web_advanced_export.js b/web_export_view/static/js/web_advanced_export.js index de13dfa1..e869a707 100644 --- a/web_export_view/static/js/web_advanced_export.js +++ b/web_export_view/static/js/web_advanced_export.js @@ -68,7 +68,7 @@ openerp.web_export_view = function(instance, m) { if($row.attr('data-id')){ export_row = []; checked = $row.find('th input[type=checkbox]').attr("checked"); - if (children || checked === "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 || ""; From 84a01633da6da90eb1fa5e495e7cbb681dceea91 Mon Sep 17 00:00:00 2001 From: Launchpad Translations on behalf of webaddons-core-editors Date: Sun, 8 Dec 2013 05:44:57 +0000 Subject: [PATCH 09/32] Launchpad automatic translations update. --- web_export_view/i18n/de.po | 23 +++++++++++++++---- web_export_view/i18n/es.po | 46 ++++++++++++++++++++++++++++++++++++++ web_export_view/i18n/fr.po | 27 +++++++++++++++++----- web_export_view/i18n/is.po | 46 ++++++++++++++++++++++++++++++++++++++ web_export_view/i18n/nl.po | 27 +++++++++++++++++----- 5 files changed, 153 insertions(+), 16 deletions(-) create mode 100644 web_export_view/i18n/es.po create mode 100644 web_export_view/i18n/is.po diff --git a/web_export_view/i18n/de.po b/web_export_view/i18n/de.po index efb20b30..d604f1d5 100644 --- a/web_export_view/i18n/de.po +++ b/web_export_view/i18n/de.po @@ -6,13 +6,14 @@ msgstr "" "Project-Id-Version: OpenERP Server 7.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-10-21 11:59+0000\n" -"PO-Revision-Date: 2013-10-21 11:59+0000\n" -"Last-Translator: <>\n" +"PO-Revision-Date: 2013-12-07 17:21+0000\n" +"Last-Translator: Nicolas JEUDY \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2014-06-28 06:02+0000\n" +"X-Generator: Launchpad (build 17077)\n" #. module: web_export_view #. openerp-web @@ -27,3 +28,17 @@ msgstr "Aktuelle Liste exportieren" #, python-format msgid "Excel" msgstr "Excel" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/js/web_advanced_export.js:81 +#, python-format +msgid "True" +msgstr "" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/js/web_advanced_export.js:84 +#, python-format +msgid "False" +msgstr "" diff --git a/web_export_view/i18n/es.po b/web_export_view/i18n/es.po new file mode 100644 index 00000000..7f6ddbd3 --- /dev/null +++ b/web_export_view/i18n/es.po @@ -0,0 +1,46 @@ +# Spanish translation for web-addons +# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 +# This file is distributed under the same license as the web-addons package. +# FIRST AUTHOR , 2014. +# +msgid "" +msgstr "" +"Project-Id-Version: web-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2013-10-21 11:59+0000\n" +"PO-Revision-Date: 2014-02-20 23:18+0000\n" +"Last-Translator: Pedro Manuel Baeza \n" +"Language-Team: Spanish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2014-06-28 06:02+0000\n" +"X-Generator: Launchpad (build 17077)\n" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/xml/web_advanced_export.xml:7 +#, python-format +msgid "Export Current View" +msgstr "Exportar vista actual" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/xml/web_advanced_export.xml:9 +#, python-format +msgid "Excel" +msgstr "Excel" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/js/web_advanced_export.js:81 +#, python-format +msgid "True" +msgstr "Verdadero" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/js/web_advanced_export.js:84 +#, python-format +msgid "False" +msgstr "Falso" diff --git a/web_export_view/i18n/fr.po b/web_export_view/i18n/fr.po index e3a43434..f7b83a89 100644 --- a/web_export_view/i18n/fr.po +++ b/web_export_view/i18n/fr.po @@ -5,21 +5,22 @@ msgid "" msgstr "" "Project-Id-Version: OpenERP Server 7.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-02-18 18:17+0000\n" -"PO-Revision-Date: 2014-02-18 18:17+0000\n" -"Last-Translator: <>\n" +"POT-Creation-Date: 2013-10-21 11:59+0000\n" +"PO-Revision-Date: 2014-03-13 09:06+0000\n" +"Last-Translator: Sylvain LE GAL (GRAP) \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2014-06-28 06:02+0000\n" +"X-Generator: Launchpad (build 17077)\n" #. module: web_export_view #. openerp-web #: code:addons/web_export_view/static/xml/web_advanced_export.xml:7 #, python-format msgid "Export Current View" -msgstr "Exporter la vue courrante" +msgstr "Exporter la vue courante" #. module: web_export_view #. openerp-web @@ -27,3 +28,17 @@ msgstr "Exporter la vue courrante" #, python-format msgid "Excel" msgstr "Excel" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/js/web_advanced_export.js:81 +#, python-format +msgid "True" +msgstr "" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/js/web_advanced_export.js:84 +#, python-format +msgid "False" +msgstr "" diff --git a/web_export_view/i18n/is.po b/web_export_view/i18n/is.po new file mode 100644 index 00000000..c3d210fc --- /dev/null +++ b/web_export_view/i18n/is.po @@ -0,0 +1,46 @@ +# Icelandic translation for web-addons +# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 +# This file is distributed under the same license as the web-addons package. +# FIRST AUTHOR , 2014. +# +msgid "" +msgstr "" +"Project-Id-Version: web-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2013-10-21 11:59+0000\n" +"PO-Revision-Date: 2014-04-11 08:56+0000\n" +"Last-Translator: Sveinn í Felli \n" +"Language-Team: Icelandic \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2014-06-28 06:02+0000\n" +"X-Generator: Launchpad (build 17077)\n" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/xml/web_advanced_export.xml:7 +#, python-format +msgid "Export Current View" +msgstr "Flytja út núverandi sýn" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/xml/web_advanced_export.xml:9 +#, python-format +msgid "Excel" +msgstr "Excel" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/js/web_advanced_export.js:81 +#, python-format +msgid "True" +msgstr "" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/js/web_advanced_export.js:84 +#, python-format +msgid "False" +msgstr "" diff --git a/web_export_view/i18n/nl.po b/web_export_view/i18n/nl.po index 96e86d5e..bae9aee8 100644 --- a/web_export_view/i18n/nl.po +++ b/web_export_view/i18n/nl.po @@ -6,24 +6,39 @@ msgstr "" "Project-Id-Version: OpenERP Server 7.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-10-21 11:59+0000\n" -"PO-Revision-Date: 2013-10-21 11:59+0000\n" -"Last-Translator: <>\n" +"PO-Revision-Date: 2013-12-07 17:21+0000\n" +"Last-Translator: Nicolas JEUDY \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2014-06-28 06:02+0000\n" +"X-Generator: Launchpad (build 17077)\n" -#. module: web +#. module: web_export_view #. openerp-web #: code:addons/web_export_view/static/xml/web_advanced_export.xml:7 #, python-format msgid "Export Current View" msgstr "Huidige lijst exporteren" -#. module: web +#. module: web_export_view #. openerp-web #: code:addons/web_export_view/static/xml/web_advanced_export.xml:9 #, python-format msgid "Excel" msgstr "Excel" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/js/web_advanced_export.js:81 +#, python-format +msgid "True" +msgstr "" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/js/web_advanced_export.js:84 +#, python-format +msgid "False" +msgstr "" From 27b4ea5031b042dab856304a045f3a4b012d7a57 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 9 Apr 2014 11:17:00 +0200 Subject: [PATCH 10/32] [web_export_view]: fixes export boolean fields --- web_export_view/i18n/web_export_view.pot | 14 ++++++++++++++ web_export_view/static/js/web_advanced_export.js | 9 +++++++++ 2 files changed, 23 insertions(+) diff --git a/web_export_view/i18n/web_export_view.pot b/web_export_view/i18n/web_export_view.pot index 9adca17c..ea6d7b6f 100644 --- a/web_export_view/i18n/web_export_view.pot +++ b/web_export_view/i18n/web_export_view.pot @@ -27,3 +27,17 @@ msgstr "" #, python-format msgid "Excel" msgstr "" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/js/web_advanced_export.js:81 +#, python-format +msgid "True" +msgstr "" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/js/web_advanced_export.js:84 +#, python-format +msgid "False" +msgstr "" diff --git a/web_export_view/static/js/web_advanced_export.js b/web_export_view/static/js/web_advanced_export.js index e869a707..36ba128a 100644 --- a/web_export_view/static/js/web_advanced_export.js +++ b/web_export_view/static/js/web_advanced_export.js @@ -75,6 +75,15 @@ openerp.web_export_view = function(instance, m) { 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 = $( '
' + cell.innerHTML + '
'); + if(data_id.find('input').get(0).checked){ + export_row.push(_t("True")); + } + else { + export_row.push(_t("False")); + } + } else if (cell.classList.contains("oe_list_field_integer")){ export_row.push(parseInt(text)); } From 05a5984688121dcff4913be55f1560deaf312963 Mon Sep 17 00:00:00 2001 From: Adil Houmadi Date: Sat, 26 Jul 2014 14:37:23 +0200 Subject: [PATCH 11/32] Migrate web_export_view to v 8.0 --- web_export_view/AUTHORS.txt | 7 -- web_export_view/README.rst | 60 ++++++++++++++++ web_export_view/__init__.py | 4 +- web_export_view/__openerp__.py | 42 ++++------- web_export_view/controllers/__init__.py | 21 ++++++ .../{ => controllers}/controllers.py | 19 +++-- web_export_view/static/description/icon.png | Bin 0 -> 3550 bytes .../js/web_export_view.js} | 67 +++++++++--------- .../xml/web_export_view_template.xml} | 5 +- web_export_view/view/web_export_view.xml | 11 +++ 10 files changed, 150 insertions(+), 86 deletions(-) delete mode 100644 web_export_view/AUTHORS.txt create mode 100644 web_export_view/README.rst create mode 100644 web_export_view/controllers/__init__.py rename web_export_view/{ => controllers}/controllers.py (80%) create mode 100644 web_export_view/static/description/icon.png rename web_export_view/static/{js/web_advanced_export.js => src/js/web_export_view.js} (66%) rename web_export_view/static/{xml/web_advanced_export.xml => src/xml/web_export_view_template.xml} (92%) create mode 100644 web_export_view/view/web_export_view.xml diff --git a/web_export_view/AUTHORS.txt b/web_export_view/AUTHORS.txt deleted file mode 100644 index 76bbca72..00000000 --- a/web_export_view/AUTHORS.txt +++ /dev/null @@ -1,7 +0,0 @@ -Authors -======= - -Simone Orsi [simahawk] -Lorenzo Battistini -Stefan Rijnhart -Leonardo Pistone diff --git a/web_export_view/README.rst b/web_export_view/README.rst new file mode 100644 index 00000000..6a0ccb67 --- /dev/null +++ b/web_export_view/README.rst @@ -0,0 +1,60 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :alt: License + +Export Current View +=================== + +One of the best OpenERP's features is exporting custom data to CSV/XLS. You can +do it by clicking on the export link in the sidebar. The export action allows +us to configure what to be exported by selecting fields, etc, and allows you +to save your export as a template so that you can export it once again without +having to configure it again. + +That feature is as great and advanced as limited for an everyday experience. +A lot of customers want simply to export the tree view they are looking to. + +If you miss this feature as us, probably you'll find an answer into our +web_export_view module. + + +Usage +===== + +After you installed it, you'll find an additional link 'Export current view' +right below the 'Export' one. By clicking on it you'll get a XLS file contains +the same data of the tree view you are looking at, headers included. + + + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed feedback +`here `_. + + +Credits +======= + +Contributors +------------ + + * Simone Orsi + * Lorenzo Battistini + * Stefan Rijnhart + * Leonardo Pistone + +Maintainer +---------- + +.. image:: http://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: http://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. + +To contribute to this module, please visit http://odoo-community.org. diff --git a/web_export_view/__init__.py b/web_export_view/__init__.py index 09691964..9a651413 100644 --- a/web_export_view/__init__.py +++ b/web_export_view/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # Copyright (C) 2012 Agile Business Group sagl () # Copyright (C) 2012 Domsense srl () # @@ -18,4 +18,4 @@ # along with this program. If not, see . # ############################################################################## -import controllers +from . import controllers diff --git a/web_export_view/__openerp__.py b/web_export_view/__openerp__.py index 555f9b27..b582b26c 100644 --- a/web_export_view/__openerp__.py +++ b/web_export_view/__openerp__.py @@ -1,9 +1,8 @@ # -*- coding: utf-8 -*- ############################################################################## # +# Copyright (C) 2012 Agile Business Group sagl () # Copyright (C) 2012 Domsense srl () -# Copyright (C) 2012-2013 Agile Business Group sagl -# () # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published @@ -22,37 +21,20 @@ { 'name': 'Export Current View', - 'version': '1.1', + 'version': '8.0.1.2.0', 'category': 'Web', - 'description': """ -WEB EXPORT VIEW -=============== - -One of the best OpenERP’s features is exporting custom data to CSV/XLS. You can -do it by clicking on the export link in the sidebar. The export action allows -use to configure what to be exported by selecting fields, etc, and allows you -to save your export as a template so that you can export it once again without -having to configure it again. - -That feature is as great and advanced as limited for an everyday experience. -A lot of customers want simply to export the tree view they are looking to. - -If you miss this feature as us, probably you’ll find an answer into our -web_export_view module. - -After you installed it, you’ll find an additional link ‘Export current view’ -right below the ‘Export’ one. By clicking on it you’ll get a XLS file contains -the same data of the tree view you are looking at, headers included. -""", - 'author': 'Agile Business Group', + 'author': "Agile Business Group,Odoo Community Association (OCA)", 'website': 'http://www.agilebg.com', 'license': 'AGPL-3', - 'depends': ['web'], - # 'external_dependencies': { - # 'python': ['xlwt'], - # }, - 'js': ['static/*/*.js', 'static/*/js/*.js'], - 'qweb': ['static/xml/web_advanced_export.xml'], + 'depends': [ + 'web', + ], + 'data': [ + 'view/web_export_view.xml', + ], + 'qweb': [ + 'static/src/xml/web_export_view_template.xml', + ], 'installable': True, 'auto_install': False, 'web_preload': False, diff --git a/web_export_view/controllers/__init__.py b/web_export_view/controllers/__init__.py new file mode 100644 index 00000000..9a651413 --- /dev/null +++ b/web_export_view/controllers/__init__.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2012 Agile Business Group sagl () +# Copyright (C) 2012 Domsense srl () +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## +from . import controllers diff --git a/web_export_view/controllers.py b/web_export_view/controllers/controllers.py similarity index 80% rename from web_export_view/controllers.py rename to web_export_view/controllers/controllers.py index 01e3e1f9..15148edb 100644 --- a/web_export_view/controllers.py +++ b/web_export_view/controllers/controllers.py @@ -1,8 +1,9 @@ # -*- coding: utf-8 -*- ############################################################################## # -# Copyright (C) 2012 Agile Business Group sagl () # Copyright (C) 2012 Domsense srl () +# Copyright (C) 2012-2013: +# Agile Business Group sagl () # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published @@ -23,31 +24,29 @@ try: except ImportError: import simplejson as json -import web.http as openerpweb - -from web.controllers.main import ExcelExport +import openerp.http as http +from openerp.http import request +from openerp.addons.web.controllers.main import ExcelExport class ExcelExportView(ExcelExport): - _cp_path = '/web/export/xls_view' - def __getattribute__(self, name): if name == 'fmt': raise AttributeError() return super(ExcelExportView, self).__getattribute__(name) - @openerpweb.httprequest - def index(self, req, data, token): + @http.route('/web/export/xls_view', type='http', auth='user') + def index(self, data, token): data = json.loads(data) model = data.get('model', []) columns_headers = data.get('headers', []) rows = data.get('rows', []) - return req.make_response( + return request.make_response( self.from_data(columns_headers, rows), headers=[ ('Content-Disposition', 'attachment; filename="%s"' - % self.filename(model)), + % self.filename(model)), ('Content-Type', self.content_type) ], cookies={'fileToken': token} diff --git a/web_export_view/static/description/icon.png b/web_export_view/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..1b1b0d1e36eff948e53360e84145f3eff07e2f0e GIT binary patch literal 3550 zcmV<44I%Q0P)`gZBePnM}Td@O1R5oP^nas?4uYWMmkWAitlguQu+~0@$ zN#^C;%gjB$d+xdCo_j~40N|VJC;ao!|6d3EGSDBWOq654pJdV0`fxBbE}!~F%_~I* z{Dgy{rq6m~aJDbtuLLdxE&@6skh=uvInU3|pEXl-H=vg<;O_$rNtDxtit~&BzJR|I z8a;dg|LMR`zz>`wRGH%h=y{W$oy$&`r;8JFayMWYP@OR00{KJ$U%>AK%F!wJ1^mN+ zF~DU)H91ZIU*HnL!9O-uv;*)0#R*63ibN?AYRF*%H1)g_ODrc))cC5d`uCk}u$&222A61CB&dMAsz6R$#u(fnX#`Yalmy-B=$|qXF5tBzvv_2Z1ku zkHf*xfn)?QgkB2<22clV4hKWyd;z~8Kmp@mI2bAu1So7wP(>fuM_kv4L>qGU{W}yD zr{jdU+h{?66mV(33t4{ELUPq)u6=V8i`Okjk&pY7m4X1NteIs6kJFvA@8799nv(Za zS*W$3Q6dOX*l-B~6gCt=fC7ggfFOWCL9c8?7uZLAtby7uKDV{SV_?v=v#2eUr^TSl0_LUQ!Yg(KEH4||;oN0Ma zx}mdV!VSzCJYEnW(~u+yRk62I?$Fg1N4ct~w%f5LfP^fy-kJy>KsbQ{1q?$FKv)0) zVF3h$1rQJxK%f92;s7Ziu4&ZABDQ2Bu_&6ZHy?7qp~zukTABhux=u76Z?y#w1V{mw zRSsgsj2aBXUQ(DtQIkH~zvA_@zOP0pUcv%o)M1jOq)JT{P4@>n(g(;X0_cX0t{X>x z8aldRpzB9}f}lzU1ja~D(U zE~d;=OsT6FDG?9AOzGA>|CZ9jT^8c@1cAZdbM_GVKtbsMNmT+3M!0U+WJ|g2yFaEO9?Mu~9f?NRv3D1Sjf4QhFgUeSSDZ=m0m6G~k6WyCptHA( zQg?C36Tn^M;;s#=Suvx=(g_;WX8_x_|J_!*{koq?-|lBx%8k44hK!DuEg!r^)ooYW zUIuPi_z3-bp50_A8Rxv3iMSl;xfw?{4DOsbhiivS%nl!5?Y52lWYUe4drC~@R?S?@ zc{SE=TGKV=j=aWFZpYqT9F81G>&R-p+>&t@xooZ&WMrv%oJ~p$l=KlmZ&PkT+9QD_ zZZFGT{FS9#nY+Z6vSdl7y8p$Naub%{m{H~D?b0?AjsEhLb(S)cB=MuMv(4vG;MOtU zwQOtWzE9b6Xur^Awh*95aq!dUAGVa6dGR>YnFZ=%Qo=^CD?SF(8vylJ*pC8!E z(|`GcrQGG`4rvxdSvqB|WxaX7{aIQzX9NK<1XWR49{RPVTyWaF6J8&R)G@Gkf73c2 z?WyIp58rLq&e9Eom=?EHqFSuQZR400v)ztmiO10mz4bcEbf<0K{V}io=Wkqi)_E;E zjYxQ%Zt5E90hlx5YRllp;&l%+3$tb#{=NfQezpB8Vv+@WR7GXyJ)6_K>Qb|p01icE z$+IijIPVvxa@P)-#624yC9Z4C95l{i?yn{E{_D8Ybi67Rzs7DP&3F4u9K&PJ0{FAmD#a( z7tj6ePeOCKL;!$ycm9j0W}dt_xoRZC`&OCC{PcxiW|Ilcd9>deN`hHy7V-FXOIsAV z!9U$}m#lXG=REc1CcGVVRa;!wI2<`*&j~aPJWe-?+hnefI-69Yqu=j_f9Y zgv1-$-)oa|wDkEk9j1JM&_7ydhXCLg)xnB?< z-M)aXr6ga~yOMZ{bp*1M0ES_3{qU(N)tNqUlx32sK#mZ=>+&#X#MLR+TQKU{q^E5K za)~W~=H>A9#7%mQDiyUzoKk0Xlojm^tW*R@eXW`0LxW_ub~+LPC~h+ok1r zf}B!2rbUw5ln&o+fgnxSSupBaQ<)dueTC}&gIoOjvdN@9Ut%gVYfTNRtZ=`L9Kw62FX%WcAPA5eVp^PAEarZI z_dfm?0FV87JyDAz-V?uZDGgdoXfGECaC*h5j2ST0RA&9#FVPT-0^oKy`RAt}S+=|4 z>P7AT{e5a4rl4o^6GgQc3r2m%QtsBL?>oMfktB(QYwzXxxhqZUjQ#pBW$vqflG5P`i{n?JB&+pvukY&_Q zRa73FQ6sdNZ3KwMV=T1c`QN_2<$2zrsBC`!4O>zN(uJcNLl6Dw zDbqQ=X5Dhj|EoxKaQ{^cg(kCw0MU4i#THk;0KEF|cPvl#?%ek&?)+nYovr9LIeXYt;?)#73ZhH^A)LqQOTb{O*b0{jejlVvl zon;sXny%X{T8lS|YPyy}JJzKQ`y!H>&e0#7db6cmT|+(Fw!fFs%^u4`Pg>>@0L&OP zmL<=w$k>fxm!JDh9{kp#HnpKDD!U)pnl%<6Z3Iwdh3g-`gA!LUU5d*n^OR8LDWTNm zrNrgM>vZFCIQeK#ZOYfWD6+zD-gtqj7gSrmhnq%TLvZ7x8R@Ke9!@c7BY-4H>^ppb zeTNSaPV=>GiY)U$=t)i~ub^vb1>HNHj3O(@l5{*JN|q!fN#^^*r*hAx$HaDVdlMkj z*!AUZu35dP(Mp2j89D|AiGP40u8qq_0yMKYN6k*+cL~Hb!PyZ9$Y)4-cpa^{WG@B$ z;UBNkXMVLU*+?wP3v*Y}ug6)<9LZicU6$74;WcAtGh@(LL4ZudNZb=>cg4{1J%RD0 zH;1&A0BtxcA+FdKK7fEAfPf%?fFOW?Ab@}%fIvY(7jb|Tpy|5hv9)7}#2S*W&kdkH z8cEw`m2T+7wN@XN6<@cJ3WoQsV%gOBwvLG#kn~<7hobV~vW;oox@f}84iY?5CkYpEC9~*1^gl_I7Ms$0;J~{ zie&M+RkKtJzsG@k;LC6@v>U(|@DmP(P=VdR$wIfb@MSm{dOIIJNH}=(+uP)DFw~W! z0imw~V}Kf96Hq7go&Qi1Y%qWid;$Ll;b3UPu|N6(eizUW=nD)0z5$#Mh|`z(vb1eY zC11c_njpk^iP9gaEP(!69}b4b<(&m+#r$y)c-a^5zkF;iNf4s~xFAu^0nP^ch;f!@ z7N8XtqdPDd7?kiedILR$1t<^#m=L2kFdVo9=mngXwklxro. // //############################################################################# +openerp.web_export_view = function (instance) { -openerp.web_export_view = function(instance, m) { - - var _t = instance.web._t, - QWeb = instance.web.qweb; + var _t = instance.web._t, QWeb = instance.web.qweb; instance.web.Sidebar.include({ - redraw: function() { + redraw: function () { var self = this; this._super.apply(this, arguments); - 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); + if (self.getParent().ViewManager.active_view == 'list') { + 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); + } }, - on_sidebar_export_view_xls: function() { + on_sidebar_export_view_xls: function () { // 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(); + view = this.getParent(), + children = view.getChildren(); if (children) { - children.every(function(child) { + children.every(function (child) { if (child.field && child.field.type == 'one2many') { view = child.viewmanager.views.list.controller; return false; // break out of the loop @@ -53,8 +53,8 @@ openerp.web_export_view = function(instance, m) { } export_columns_keys = []; export_columns_names = []; - $.each(view.visible_columns, function(){ - if(this.tag=='field'){ + $.each(view.visible_columns, function () { + if (this.tag == 'field') { // non-fields like `_group` or buttons export_columns_keys.push(this.id); export_columns_names.push(this.string); @@ -62,51 +62,50 @@ openerp.web_export_view = function(instance, m) { }); rows = view.$el.find('.oe_list_content > tbody > tr'); export_rows = []; - $.each(rows,function(){ + $.each(rows, function () { $row = $(this); // find only rows with data - if($row.attr('data-id')){ + 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); + 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")){ + 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 = $( '
' + cell.innerHTML + '
'); - if(data_id.find('input').get(0).checked){ - export_row.push(_t("True")); + else if (cell.classList.contains("oe_list_field_boolean")) { + var data_id = $('
' + cell.innerHTML + '
'); + if (data_id.find('input').get(0).checked) { + export_row.push(_t("True")); } else { - export_row.push(_t("False")); + export_row.push(_t("False")); } } - else if (cell.classList.contains("oe_list_field_integer")){ - export_row.push(parseInt(text)); + else if (cell.classList.contains("oe_list_field_integer")) { + export_row.push(parseInt(text)); } - else{ - export_row.push(text.trim()); + else { + export_row.push(text.trim()); } }); export_rows.push(export_row); - }; + } } }); $.blockUI(); view.session.get_file({ url: '/web/export/xls_view', data: {data: JSON.stringify({ - model : view.model, - headers : export_columns_names, - rows : export_rows, + model: view.model, + headers: export_columns_names, + rows: export_rows })}, complete: $.unblockUI }); - }, - + } }); }; diff --git a/web_export_view/static/xml/web_advanced_export.xml b/web_export_view/static/src/xml/web_export_view_template.xml similarity index 92% rename from web_export_view/static/xml/web_advanced_export.xml rename to web_export_view/static/src/xml/web_export_view_template.xml index cb4b5004..fbd855d9 100644 --- a/web_export_view/static/xml/web_advanced_export.xml +++ b/web_export_view/static/src/xml/web_export_view_template.xml @@ -1,6 +1,5 @@ - +
@@ -10,4 +9,4 @@
-
+ \ No newline at end of file diff --git a/web_export_view/view/web_export_view.xml b/web_export_view/view/web_export_view.xml new file mode 100644 index 00000000..502070f1 --- /dev/null +++ b/web_export_view/view/web_export_view.xml @@ -0,0 +1,11 @@ + + + + + + + From c5cd91d062e6c4d7995d97ca1f18c84595cddf04 Mon Sep 17 00:00:00 2001 From: "Torvald B. Bringsvor" Date: Sat, 7 Feb 2015 13:56:50 +0100 Subject: [PATCH 12/32] Small fix to allow integers to be parsed correctly when a locate with a thousand separator is used. --- web_export_view/static/src/js/web_export_view.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 df4419de..e5fe0123 100644 --- a/web_export_view/static/src/js/web_export_view.js +++ b/web_export_view/static/src/js/web_export_view.js @@ -85,7 +85,8 @@ openerp.web_export_view = function (instance) { } } else if (cell.classList.contains("oe_list_field_integer")) { - export_row.push(parseInt(text)); + tmp2 = text.replace(instance.web._t.database.parameters.thousands_sep, ""); + export_row.push(parseInt(tmp2)); } else { export_row.push(text.trim()); From fed3e550fcfc299841ad13835bf4589195a19240 Mon Sep 17 00:00:00 2001 From: PabloCM Date: Thu, 5 Mar 2015 12:12:06 +0100 Subject: [PATCH 13/32] [FIX] web_export_view: Handler method renamed to avoid name collision with the original index used in the native excel export --- web_export_view/controllers/controllers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_export_view/controllers/controllers.py b/web_export_view/controllers/controllers.py index 15148edb..a38eec52 100644 --- a/web_export_view/controllers/controllers.py +++ b/web_export_view/controllers/controllers.py @@ -36,7 +36,7 @@ class ExcelExportView(ExcelExport): return super(ExcelExportView, self).__getattribute__(name) @http.route('/web/export/xls_view', type='http', auth='user') - def index(self, data, token): + def export_xls_view(self, data, token): data = json.loads(data) model = data.get('model', []) columns_headers = data.get('headers', []) From 99cbc71af384db8e217ea793e1c91df016f02213 Mon Sep 17 00:00:00 2001 From: "Torvald B. Bringsvor" Date: Thu, 26 Mar 2015 12:20:04 +0100 Subject: [PATCH 14/32] Handle the thousands separator, even multiple ones. --- web_export_view/static/src/js/web_export_view.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 e5fe0123..00cb047e 100644 --- a/web_export_view/static/src/js/web_export_view.js +++ b/web_export_view/static/src/js/web_export_view.js @@ -85,7 +85,12 @@ openerp.web_export_view = function (instance) { } } else if (cell.classList.contains("oe_list_field_integer")) { - tmp2 = text.replace(instance.web._t.database.parameters.thousands_sep, ""); + var tmp2 = text; + do { + tmp = tmp2; + tmp2 = tmp.replace(instance.web._t.database.parameters.thousands_sep, ""); + } while (tmp !== tmp2); + export_row.push(parseInt(tmp2)); } else { From 7130115ddcefad8b24d7810f8466bb6d2ffc0c43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matja=C5=BE=20Mozeti=C4=8D?= Date: Fri, 24 Apr 2015 08:09:56 +0200 Subject: [PATCH 15/32] Slovene translations and translation template --- web_export_view/i18n/sl.po | 47 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 web_export_view/i18n/sl.po diff --git a/web_export_view/i18n/sl.po b/web_export_view/i18n/sl.po new file mode 100644 index 00000000..832cf5b4 --- /dev/null +++ b/web_export_view/i18n/sl.po @@ -0,0 +1,47 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# +# Matjaž Mozetič , 2015. +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2013-10-21 11:59+0000\n" +"PO-Revision-Date: 2015-04-24 08:07+0100\n" +"Last-Translator: Matjaž Mozetič \n" +"Language-Team: Slovenian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" +"Language: sl\n" +"X-Generator: Lokalize 2.0\n" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/xml/web_advanced_export.xml:7 +#, python-format +msgid "Export Current View" +msgstr "Izvoz trenutnega pogleda" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/xml/web_advanced_export.xml:9 +#, python-format +msgid "Excel" +msgstr "Excel" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/js/web_advanced_export.js:81 +#, python-format +msgid "True" +msgstr "Pravilno" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/js/web_advanced_export.js:84 +#, python-format +msgid "False" +msgstr "Nepravilno" + From 4935fab7273732790095bd9a9e1ded0ca2d66b7e Mon Sep 17 00:00:00 2001 From: Henry Zhou Date: Mon, 21 Nov 2016 15:39:17 +0800 Subject: [PATCH 16/32] [MIG 10.0] web_export_view (#444) --- web_export_view/README.rst | 28 ++++-- web_export_view/__init__.py | 20 +--- web_export_view/__manifest__.py | 28 ++++++ web_export_view/__openerp__.py | 41 -------- web_export_view/controllers/__init__.py | 20 +--- web_export_view/controllers/controllers.py | 36 ++----- web_export_view/i18n/de.po | 44 --------- web_export_view/i18n/es.po | 46 --------- web_export_view/i18n/fr.po | 44 --------- web_export_view/i18n/is.po | 46 --------- web_export_view/i18n/nl.po | 44 --------- web_export_view/i18n/sl.po | 47 --------- web_export_view/i18n/web_export_view.pot | 43 -------- web_export_view/i18n/zh_CN.po | 38 +++++++ .../static/src/js/web_export_view.js | 99 ++++++++----------- .../src/xml/web_export_view_template.xml | 13 ++- web_export_view/view/web_export_view.xml | 11 --- .../views/web_export_view_view.xml | 9 ++ 18 files changed, 156 insertions(+), 501 deletions(-) create mode 100644 web_export_view/__manifest__.py delete mode 100644 web_export_view/__openerp__.py delete mode 100644 web_export_view/i18n/de.po delete mode 100644 web_export_view/i18n/es.po delete mode 100644 web_export_view/i18n/fr.po delete mode 100644 web_export_view/i18n/is.po delete mode 100644 web_export_view/i18n/nl.po delete mode 100644 web_export_view/i18n/sl.po delete mode 100644 web_export_view/i18n/web_export_view.pot create mode 100644 web_export_view/i18n/zh_CN.po delete mode 100644 web_export_view/view/web_export_view.xml create mode 100644 web_export_view/views/web_export_view_view.xml diff --git a/web_export_view/README.rst b/web_export_view/README.rst index 6a0ccb67..4f765987 100644 --- a/web_export_view/README.rst +++ b/web_export_view/README.rst @@ -4,7 +4,7 @@ Export Current View =================== -One of the best OpenERP's features is exporting custom data to CSV/XLS. You can +One of the best Odoo's features is exporting custom data to CSV/XLS. You can do it by clicking on the export link in the sidebar. The export action allows us to configure what to be exported by selecting fields, etc, and allows you to save your export as a template so that you can export it once again without @@ -21,19 +21,31 @@ Usage ===== After you installed it, you'll find an additional link 'Export current view' -right below the 'Export' one. By clicking on it you'll get a XLS file contains +right on the sidebar. By clicking on it you'll get a XLS file contains the same data of the tree view you are looking at, headers included. +Known Issues +============ + +Pedro M. Baeza (pedro.baeza@gmail.com): +When you have groups, they are not exported to Excel. It would be desirable to have this option. +One of the problems with this module is that you can't export data from a view with mode="tree". +Changing the approach to have the button always visible (we should relocate it also to another place, +as the current location is not visible for these views), and digging correctly in the DOM elements +for this view (very similar to the normal tree view one) will do the trick. This will also help users +to locate the feature, as it's hidden now by default and users don't think about selecting records. +The behavior will be: nothing selected > you export all (including groups). +Something or all selected: export the selection. + Bug Tracker =========== -Bugs are tracked on `GitHub Issues `_. -In case of trouble, please check there if your issue has already been reported. -If you spotted it first, help us smashing it by providing a detailed and welcomed feedback -`here `_. - +Bugs are tracked on `GitHub Issues +`_. In case of trouble, please +check there if your issue has already been reported. If you spotted it first, +help us smashing it by providing a detailed and welcomed feedback. Credits ======= @@ -41,6 +53,8 @@ Credits Contributors ------------ + * Henry Zhou (MAXodoo) + * Rodney * Simone Orsi * Lorenzo Battistini * Stefan Rijnhart diff --git a/web_export_view/__init__.py b/web_export_view/__init__.py index 9a651413..b0f26a9a 100644 --- a/web_export_view/__init__.py +++ b/web_export_view/__init__.py @@ -1,21 +1,3 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Copyright (C) 2012 Agile Business Group sagl () -# Copyright (C) 2012 Domsense srl () -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## + from . import controllers diff --git a/web_export_view/__manifest__.py b/web_export_view/__manifest__.py new file mode 100644 index 00000000..2281d685 --- /dev/null +++ b/web_export_view/__manifest__.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Copyright 2016 Henry Zhou (http://www.maxodoo.com) +# Copyright 2016 Rodney (http://clearcorp.cr/) +# Copyright 2012 Agile Business Group +# Copyright 2012 Domsense srl () +# Copyright 2012 Therp BV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + 'name': 'Web Export Current View', + 'version': '10.0.1.0.0', + 'category': 'Web', + 'author': 'Henry Zhou, Agile Business Group, \ + Odoo Community Association (OCA)', + 'website': 'http://www.agilebg.com', + 'license': 'AGPL-3', + 'depends': [ + 'web', + ], + "data": [ + 'views/web_export_view_view.xml', + ], + 'qweb': [ + "static/src/xml/web_export_view_template.xml", + ], + 'installable': True, + 'auto_install': False, +} diff --git a/web_export_view/__openerp__.py b/web_export_view/__openerp__.py deleted file mode 100644 index b582b26c..00000000 --- a/web_export_view/__openerp__.py +++ /dev/null @@ -1,41 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Copyright (C) 2012 Agile Business Group sagl () -# Copyright (C) 2012 Domsense srl () -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -{ - 'name': 'Export Current View', - 'version': '8.0.1.2.0', - 'category': 'Web', - 'author': "Agile Business Group,Odoo Community Association (OCA)", - 'website': 'http://www.agilebg.com', - 'license': 'AGPL-3', - 'depends': [ - 'web', - ], - 'data': [ - 'view/web_export_view.xml', - ], - 'qweb': [ - 'static/src/xml/web_export_view_template.xml', - ], - 'installable': True, - 'auto_install': False, - 'web_preload': False, -} diff --git a/web_export_view/controllers/__init__.py b/web_export_view/controllers/__init__.py index 9a651413..b0f26a9a 100644 --- a/web_export_view/controllers/__init__.py +++ b/web_export_view/controllers/__init__.py @@ -1,21 +1,3 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Copyright (C) 2012 Agile Business Group sagl () -# Copyright (C) 2012 Domsense srl () -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## + from . import controllers diff --git a/web_export_view/controllers/controllers.py b/web_export_view/controllers/controllers.py index a38eec52..090a96de 100644 --- a/web_export_view/controllers/controllers.py +++ b/web_export_view/controllers/controllers.py @@ -1,32 +1,14 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Copyright (C) 2012 Domsense srl () -# Copyright (C) 2012-2013: -# Agile Business Group sagl () -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## -try: - import json -except ImportError: - import simplejson as json +# Copyright 2016 Henry Zhou (http://www.maxodoo.com) +# Copyright 2016 Rodney (http://clearcorp.cr/) +# Copyright 2012 Agile Business Group +# Copyright 2012 Therp BV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -import openerp.http as http -from openerp.http import request -from openerp.addons.web.controllers.main import ExcelExport +import json +import odoo.http as http +from odoo.http import request +from odoo.addons.web.controllers.main import ExcelExport class ExcelExportView(ExcelExport): diff --git a/web_export_view/i18n/de.po b/web_export_view/i18n/de.po deleted file mode 100644 index d604f1d5..00000000 --- a/web_export_view/i18n/de.po +++ /dev/null @@ -1,44 +0,0 @@ -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 7.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-10-21 11:59+0000\n" -"PO-Revision-Date: 2013-12-07 17:21+0000\n" -"Last-Translator: Nicolas JEUDY \n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-06-28 06:02+0000\n" -"X-Generator: Launchpad (build 17077)\n" - -#. module: web_export_view -#. openerp-web -#: code:addons/web_export_view/static/xml/web_advanced_export.xml:7 -#, python-format -msgid "Export Current View" -msgstr "Aktuelle Liste exportieren" - -#. module: web_export_view -#. openerp-web -#: code:addons/web_export_view/static/xml/web_advanced_export.xml:9 -#, python-format -msgid "Excel" -msgstr "Excel" - -#. module: web_export_view -#. openerp-web -#: code:addons/web_export_view/static/src/js/web_advanced_export.js:81 -#, python-format -msgid "True" -msgstr "" - -#. module: web_export_view -#. openerp-web -#: code:addons/web_export_view/static/src/js/web_advanced_export.js:84 -#, python-format -msgid "False" -msgstr "" diff --git a/web_export_view/i18n/es.po b/web_export_view/i18n/es.po deleted file mode 100644 index 7f6ddbd3..00000000 --- a/web_export_view/i18n/es.po +++ /dev/null @@ -1,46 +0,0 @@ -# Spanish translation for web-addons -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the web-addons package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: web-addons\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2013-10-21 11:59+0000\n" -"PO-Revision-Date: 2014-02-20 23:18+0000\n" -"Last-Translator: Pedro Manuel Baeza \n" -"Language-Team: Spanish \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-06-28 06:02+0000\n" -"X-Generator: Launchpad (build 17077)\n" - -#. module: web_export_view -#. openerp-web -#: code:addons/web_export_view/static/xml/web_advanced_export.xml:7 -#, python-format -msgid "Export Current View" -msgstr "Exportar vista actual" - -#. module: web_export_view -#. openerp-web -#: code:addons/web_export_view/static/xml/web_advanced_export.xml:9 -#, python-format -msgid "Excel" -msgstr "Excel" - -#. module: web_export_view -#. openerp-web -#: code:addons/web_export_view/static/src/js/web_advanced_export.js:81 -#, python-format -msgid "True" -msgstr "Verdadero" - -#. module: web_export_view -#. openerp-web -#: code:addons/web_export_view/static/src/js/web_advanced_export.js:84 -#, python-format -msgid "False" -msgstr "Falso" diff --git a/web_export_view/i18n/fr.po b/web_export_view/i18n/fr.po deleted file mode 100644 index f7b83a89..00000000 --- a/web_export_view/i18n/fr.po +++ /dev/null @@ -1,44 +0,0 @@ -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 7.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-10-21 11:59+0000\n" -"PO-Revision-Date: 2014-03-13 09:06+0000\n" -"Last-Translator: Sylvain LE GAL (GRAP) \n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-06-28 06:02+0000\n" -"X-Generator: Launchpad (build 17077)\n" - -#. module: web_export_view -#. openerp-web -#: code:addons/web_export_view/static/xml/web_advanced_export.xml:7 -#, python-format -msgid "Export Current View" -msgstr "Exporter la vue courante" - -#. module: web_export_view -#. openerp-web -#: code:addons/web_export_view/static/xml/web_advanced_export.xml:9 -#, python-format -msgid "Excel" -msgstr "Excel" - -#. module: web_export_view -#. openerp-web -#: code:addons/web_export_view/static/src/js/web_advanced_export.js:81 -#, python-format -msgid "True" -msgstr "" - -#. module: web_export_view -#. openerp-web -#: code:addons/web_export_view/static/src/js/web_advanced_export.js:84 -#, python-format -msgid "False" -msgstr "" diff --git a/web_export_view/i18n/is.po b/web_export_view/i18n/is.po deleted file mode 100644 index c3d210fc..00000000 --- a/web_export_view/i18n/is.po +++ /dev/null @@ -1,46 +0,0 @@ -# Icelandic translation for web-addons -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the web-addons package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: web-addons\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2013-10-21 11:59+0000\n" -"PO-Revision-Date: 2014-04-11 08:56+0000\n" -"Last-Translator: Sveinn í Felli \n" -"Language-Team: Icelandic \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-06-28 06:02+0000\n" -"X-Generator: Launchpad (build 17077)\n" - -#. module: web_export_view -#. openerp-web -#: code:addons/web_export_view/static/xml/web_advanced_export.xml:7 -#, python-format -msgid "Export Current View" -msgstr "Flytja út núverandi sýn" - -#. module: web_export_view -#. openerp-web -#: code:addons/web_export_view/static/xml/web_advanced_export.xml:9 -#, python-format -msgid "Excel" -msgstr "Excel" - -#. module: web_export_view -#. openerp-web -#: code:addons/web_export_view/static/src/js/web_advanced_export.js:81 -#, python-format -msgid "True" -msgstr "" - -#. module: web_export_view -#. openerp-web -#: code:addons/web_export_view/static/src/js/web_advanced_export.js:84 -#, python-format -msgid "False" -msgstr "" diff --git a/web_export_view/i18n/nl.po b/web_export_view/i18n/nl.po deleted file mode 100644 index bae9aee8..00000000 --- a/web_export_view/i18n/nl.po +++ /dev/null @@ -1,44 +0,0 @@ -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 7.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-10-21 11:59+0000\n" -"PO-Revision-Date: 2013-12-07 17:21+0000\n" -"Last-Translator: Nicolas JEUDY \n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-06-28 06:02+0000\n" -"X-Generator: Launchpad (build 17077)\n" - -#. module: web_export_view -#. openerp-web -#: code:addons/web_export_view/static/xml/web_advanced_export.xml:7 -#, python-format -msgid "Export Current View" -msgstr "Huidige lijst exporteren" - -#. module: web_export_view -#. openerp-web -#: code:addons/web_export_view/static/xml/web_advanced_export.xml:9 -#, python-format -msgid "Excel" -msgstr "Excel" - -#. module: web_export_view -#. openerp-web -#: code:addons/web_export_view/static/src/js/web_advanced_export.js:81 -#, python-format -msgid "True" -msgstr "" - -#. module: web_export_view -#. openerp-web -#: code:addons/web_export_view/static/src/js/web_advanced_export.js:84 -#, python-format -msgid "False" -msgstr "" diff --git a/web_export_view/i18n/sl.po b/web_export_view/i18n/sl.po deleted file mode 100644 index 832cf5b4..00000000 --- a/web_export_view/i18n/sl.po +++ /dev/null @@ -1,47 +0,0 @@ -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# -# Matjaž Mozetič , 2015. -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 7.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-10-21 11:59+0000\n" -"PO-Revision-Date: 2015-04-24 08:07+0100\n" -"Last-Translator: Matjaž Mozetič \n" -"Language-Team: Slovenian \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" -"Language: sl\n" -"X-Generator: Lokalize 2.0\n" - -#. module: web_export_view -#. openerp-web -#: code:addons/web_export_view/static/xml/web_advanced_export.xml:7 -#, python-format -msgid "Export Current View" -msgstr "Izvoz trenutnega pogleda" - -#. module: web_export_view -#. openerp-web -#: code:addons/web_export_view/static/xml/web_advanced_export.xml:9 -#, python-format -msgid "Excel" -msgstr "Excel" - -#. module: web_export_view -#. openerp-web -#: code:addons/web_export_view/static/src/js/web_advanced_export.js:81 -#, python-format -msgid "True" -msgstr "Pravilno" - -#. module: web_export_view -#. openerp-web -#: code:addons/web_export_view/static/src/js/web_advanced_export.js:84 -#, python-format -msgid "False" -msgstr "Nepravilno" - diff --git a/web_export_view/i18n/web_export_view.pot b/web_export_view/i18n/web_export_view.pot deleted file mode 100644 index ea6d7b6f..00000000 --- a/web_export_view/i18n/web_export_view.pot +++ /dev/null @@ -1,43 +0,0 @@ -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 7.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-10-21 11:59+0000\n" -"PO-Revision-Date: 2013-10-21 11:59+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: web_export_view -#. openerp-web -#: code:addons/web_export_view/static/xml/web_advanced_export.xml:7 -#, python-format -msgid "Export Current View" -msgstr "" - -#. module: web_export_view -#. openerp-web -#: code:addons/web_export_view/static/xml/web_advanced_export.xml:9 -#, python-format -msgid "Excel" -msgstr "" - -#. module: web_export_view -#. openerp-web -#: code:addons/web_export_view/static/src/js/web_advanced_export.js:81 -#, python-format -msgid "True" -msgstr "" - -#. module: web_export_view -#. openerp-web -#: code:addons/web_export_view/static/src/js/web_advanced_export.js:84 -#, python-format -msgid "False" -msgstr "" diff --git a/web_export_view/i18n/zh_CN.po b/web_export_view/i18n/zh_CN.po new file mode 100644 index 00000000..717fb78e --- /dev/null +++ b/web_export_view/i18n/zh_CN.po @@ -0,0 +1,38 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_export_view +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-11-04 02:11+0000\n" +"PO-Revision-Date: 2016-11-04 02:11+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/xml/web_export_view_template.xml:6 +#, python-format +msgid "Export xls" +msgstr "导出 xls" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/js/web_export_view.js:66 +#, python-format +msgid "False" +msgstr "否" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/js/web_export_view.js:63 +#, python-format +msgid "True" +msgstr "是" + 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..68be0964 100644 --- a/web_export_view/static/src/js/web_export_view.js +++ b/web_export_view/static/src/js/web_export_view.js @@ -1,38 +1,24 @@ -// @@@ web_export_view custom JS @@@ -//############################################################################# -// -// Copyright (C) 2012 Agile Business Group sagl () -// Copyright (C) 2012 Therp BV () -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published -// by the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . -// -//############################################################################# -openerp.web_export_view = function (instance) { +odoo.define('web_export_view', function (require) { +"use strict"; - var _t = instance.web._t, QWeb = instance.web.qweb; + var core = require('web.core'); + var Sidebar = require('web.Sidebar'); + var QWeb = core.qweb; + + var _t = core._t; + + Sidebar.include({ - instance.web.Sidebar.include({ redraw: function () { var self = this; this._super.apply(this, arguments); - if (self.getParent().ViewManager.active_view == 'list') { - 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); + if (self.getParent().ViewManager.active_view.type == 'list') { + self.$el.find('.o_dropdown').last().append(QWeb.render('WebExportTreeViewXls', {widget: self})); + self.$el.find('.export_treeview_xls').on('click', self.on_sidebar_export_treeview_xls); } }, - on_sidebar_export_view_xls: function () { + on_sidebar_export_treeview_xls: function () { // Select the first list of the current (form) view // or assume the main view is a list view and use that var self = this, @@ -51,50 +37,51 @@ openerp.web_export_view = function (instance) { return true; }); } - export_columns_keys = []; - export_columns_names = []; + var export_columns_keys = []; + var export_columns_names = []; $.each(view.visible_columns, function () { - if (this.tag == 'field') { + if (this.tag == 'field' && (this.widget === undefined || this.widget != 'handle')) { // non-fields like `_group` or buttons export_columns_keys.push(this.id); export_columns_names.push(this.string); } }); - rows = view.$el.find('.oe_list_content > tbody > tr'); - export_rows = []; + var rows = view.$el.find('.o_list_view > tbody > tr'); + var export_rows = []; $.each(rows, function () { - $row = $(this); + var $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") { + var export_row = []; + var checked = $row.find('.o_list_record_selector input[type=checkbox]').is(':checked'); + if (children && checked === true) { $.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 = $('
' + cell.innerHTML + '
'); - if (data_id.find('input').get(0).checked) { + var $cell = $row.find('td[data-field="' + this + '"]') + var $cellcheckbox = $cell.find('.o_checkbox input[type=checkbox]'); + if ($cellcheckbox.length) { + if ($cellcheckbox.is(':checked')) { export_row.push(_t("True")); } else { export_row.push(_t("False")); } } - else if (cell.classList.contains("oe_list_field_integer")) { - var tmp2 = text; - do { - tmp = tmp2; - tmp2 = tmp.replace(instance.web._t.database.parameters.thousands_sep, ""); - } while (tmp !== tmp2); - - export_row.push(parseInt(tmp2)); - } else { - export_row.push(text.trim()); + var cell = $cell.get(0); + var text = cell.text || cell.textContent || cell.innerHTML || ""; + + if (cell.classList.contains("o_list_number")) { + var tmp2 = text; + do { + var tmp = tmp2; + tmp2 = tmp.replace(_t.database.parameters.thousands_sep, ""); + } while (tmp !== tmp2); + tmp2 = tmp.replace(_t.database.parameters.decimal_point, "."); + export_row.push(parseFloat(tmp2)); + } + else { + export_row.push(text.trim()); + } } }); export_rows.push(export_row); @@ -112,6 +99,6 @@ openerp.web_export_view = function (instance) { complete: $.unblockUI }); } - }); -}; + }); +}); diff --git a/web_export_view/static/src/xml/web_export_view_template.xml b/web_export_view/static/src/xml/web_export_view_template.xml index fbd855d9..32bd002e 100644 --- a/web_export_view/static/src/xml/web_export_view_template.xml +++ b/web_export_view/static/src/xml/web_export_view_template.xml @@ -1,12 +1,11 @@ - -
- -
    -
  • Excel
  • -
+ +
+
- \ No newline at end of file + diff --git a/web_export_view/view/web_export_view.xml b/web_export_view/view/web_export_view.xml deleted file mode 100644 index 502070f1..00000000 --- a/web_export_view/view/web_export_view.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - diff --git a/web_export_view/views/web_export_view_view.xml b/web_export_view/views/web_export_view_view.xml new file mode 100644 index 00000000..4787238e --- /dev/null +++ b/web_export_view/views/web_export_view_view.xml @@ -0,0 +1,9 @@ + + + + + From efd42c0ed295fdbbe39668a326c12382b9dc9f6c Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Sat, 24 Dec 2016 01:39:11 -0500 Subject: [PATCH 17/32] OCA Transbot updated translations from Transifex --- web_export_view/i18n/de.po | 40 +++++++++++++++++++++++++++++++++++ web_export_view/i18n/es.po | 40 +++++++++++++++++++++++++++++++++++ web_export_view/i18n/hr.po | 40 +++++++++++++++++++++++++++++++++++ web_export_view/i18n/nl_NL.po | 40 +++++++++++++++++++++++++++++++++++ web_export_view/i18n/pt_BR.po | 40 +++++++++++++++++++++++++++++++++++ web_export_view/i18n/zh_CN.po | 20 ++++++++++-------- 6 files changed, 211 insertions(+), 9 deletions(-) create mode 100644 web_export_view/i18n/de.po create mode 100644 web_export_view/i18n/es.po create mode 100644 web_export_view/i18n/hr.po create mode 100644 web_export_view/i18n/nl_NL.po create mode 100644 web_export_view/i18n/pt_BR.po diff --git a/web_export_view/i18n/de.po b/web_export_view/i18n/de.po new file mode 100644 index 00000000..0bc8e4f8 --- /dev/null +++ b/web_export_view/i18n/de.po @@ -0,0 +1,40 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_export_view +# +# Translators: +# Niki Waibel , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-04-28 18:03+0000\n" +"PO-Revision-Date: 2017-04-28 18:03+0000\n" +"Last-Translator: Niki Waibel , 2017\n" +"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: de\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/xml/web_export_view_template.xml:6 +#, python-format +msgid "Export xls" +msgstr "Exportiere xls" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/js/web_export_view.js:63 +#, python-format +msgid "False" +msgstr "Falsch" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/js/web_export_view.js:63 +#, python-format +msgid "True" +msgstr "Richtig" diff --git a/web_export_view/i18n/es.po b/web_export_view/i18n/es.po new file mode 100644 index 00000000..b2e3decf --- /dev/null +++ b/web_export_view/i18n/es.po @@ -0,0 +1,40 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_export_view +# +# Translators: +# OCA Transbot , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-04-28 18:03+0000\n" +"PO-Revision-Date: 2017-04-28 18:03+0000\n" +"Last-Translator: OCA Transbot , 2016\n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: es\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/xml/web_export_view_template.xml:6 +#, python-format +msgid "Export xls" +msgstr "Exportar XLS" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/js/web_export_view.js:63 +#, python-format +msgid "False" +msgstr "Falso" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/js/web_export_view.js:63 +#, python-format +msgid "True" +msgstr "Verdadero" diff --git a/web_export_view/i18n/hr.po b/web_export_view/i18n/hr.po new file mode 100644 index 00000000..786e25fd --- /dev/null +++ b/web_export_view/i18n/hr.po @@ -0,0 +1,40 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_export_view +# +# Translators: +# Bole , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-04-28 18:03+0000\n" +"PO-Revision-Date: 2017-04-28 18:03+0000\n" +"Last-Translator: Bole , 2017\n" +"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: hr\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/xml/web_export_view_template.xml:6 +#, python-format +msgid "Export xls" +msgstr "Izvoz u XLS" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/js/web_export_view.js:63 +#, python-format +msgid "False" +msgstr "NE" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/js/web_export_view.js:63 +#, python-format +msgid "True" +msgstr "DA" diff --git a/web_export_view/i18n/nl_NL.po b/web_export_view/i18n/nl_NL.po new file mode 100644 index 00000000..6204c697 --- /dev/null +++ b/web_export_view/i18n/nl_NL.po @@ -0,0 +1,40 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_export_view +# +# Translators: +# Peter Hageman , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-01 03:34+0000\n" +"PO-Revision-Date: 2017-07-01 03:34+0000\n" +"Last-Translator: Peter Hageman , 2017\n" +"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/teams/23907/nl_NL/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: nl_NL\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/xml/web_export_view_template.xml:6 +#, python-format +msgid "Export xls" +msgstr "Exporteer xls" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/js/web_export_view.js:63 +#, python-format +msgid "False" +msgstr "Fout" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/js/web_export_view.js:63 +#, python-format +msgid "True" +msgstr "Waar" diff --git a/web_export_view/i18n/pt_BR.po b/web_export_view/i18n/pt_BR.po new file mode 100644 index 00000000..08eaaf44 --- /dev/null +++ b/web_export_view/i18n/pt_BR.po @@ -0,0 +1,40 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_export_view +# +# Translators: +# Rodrigo de Almeida Sottomaior Macedo , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-22 08:26+0000\n" +"PO-Revision-Date: 2017-06-22 08:26+0000\n" +"Last-Translator: Rodrigo de Almeida Sottomaior Macedo , 2017\n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/23907/pt_BR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: pt_BR\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/xml/web_export_view_template.xml:6 +#, python-format +msgid "Export xls" +msgstr "Exportar xls" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/js/web_export_view.js:63 +#, python-format +msgid "False" +msgstr "Falso" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/js/web_export_view.js:63 +#, python-format +msgid "True" +msgstr "Verdadeiro" diff --git a/web_export_view/i18n/zh_CN.po b/web_export_view/i18n/zh_CN.po index 717fb78e..63084d07 100644 --- a/web_export_view/i18n/zh_CN.po +++ b/web_export_view/i18n/zh_CN.po @@ -1,19 +1,22 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * web_export_view -# +# * web_export_view +# +# Translators: +# OCA Transbot , 2016 msgid "" msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-11-04 02:11+0000\n" -"PO-Revision-Date: 2016-11-04 02:11+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" +"POT-Creation-Date: 2017-04-28 18:03+0000\n" +"PO-Revision-Date: 2017-04-28 18:03+0000\n" +"Last-Translator: OCA Transbot , 2016\n" +"Language-Team: Chinese (China) (https://www.transifex.com/oca/teams/23907/zh_CN/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Plural-Forms: \n" +"Language: zh_CN\n" +"Plural-Forms: nplurals=1; plural=0;\n" #. module: web_export_view #. openerp-web @@ -24,7 +27,7 @@ msgstr "导出 xls" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:66 +#: code:addons/web_export_view/static/src/js/web_export_view.js:63 #, python-format msgid "False" msgstr "否" @@ -35,4 +38,3 @@ msgstr "否" #, python-format msgid "True" msgstr "是" - From 971a20fddc029182145b76cbcf1597b8b682610c Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Fri, 31 Mar 2017 13:55:22 +0200 Subject: [PATCH 18/32] [FIX][web_export_view] Remove monetary formatting (#594) Monetary fields were being exported empty because the parsing failed. In the way of correctly exporting them as numbers, this chunk of code's performance has been improved. --- .../static/src/js/web_export_view.js | 70 +++++++++---------- 1 file changed, 33 insertions(+), 37 deletions(-) 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 68be0964..3b4fb0bc 100644 --- a/web_export_view/static/src/js/web_export_view.js +++ b/web_export_view/static/src/js/web_export_view.js @@ -46,49 +46,45 @@ odoo.define('web_export_view', function (require) { export_columns_names.push(this.string); } }); - var rows = view.$el.find('.o_list_view > tbody > tr'); var export_rows = []; - $.each(rows, function () { - var $row = $(this); + $.blockUI(); + if (children) { // find only rows with data - if ($row.attr('data-id')) { + view.$el.find('.o_list_view > tbody > tr[data-id]:has(.o_list_record_selector input:checkbox:checked)') + .each(function () { + var $row = $(this); var export_row = []; - var checked = $row.find('.o_list_record_selector input[type=checkbox]').is(':checked'); - if (children && checked === true) { - $.each(export_columns_keys, function () { - var $cell = $row.find('td[data-field="' + this + '"]') - var $cellcheckbox = $cell.find('.o_checkbox input[type=checkbox]'); - if ($cellcheckbox.length) { - if ($cellcheckbox.is(':checked')) { - export_row.push(_t("True")); - } - else { - export_row.push(_t("False")); - } + $.each(export_columns_keys, function () { + var $cell = $row.find('td[data-field="' + this + '"]') + var $cellcheckbox = $cell.find('.o_checkbox input:checkbox'); + if ($cellcheckbox.length) { + export_row.push( + $cellcheckbox.is(":checked") + ? _t("True") : _t("False") + ); + } + else { + var text = $cell.text().trim(); + if ($cell.hasClass("o_list_number")) { + export_row.push(parseFloat( + text + // Remove thousands separator + .split(_t.database.parameters.thousands_sep) + .join("") + // Always use a `.` as decimal separator + .replace(_t.database.parameters.decimal_point, ".") + // Remove non-numeric characters + .replace(/[^\d\.-]/g, "") + )); } else { - var cell = $cell.get(0); - var text = cell.text || cell.textContent || cell.innerHTML || ""; - - if (cell.classList.contains("o_list_number")) { - var tmp2 = text; - do { - var tmp = tmp2; - tmp2 = tmp.replace(_t.database.parameters.thousands_sep, ""); - } while (tmp !== tmp2); - tmp2 = tmp.replace(_t.database.parameters.decimal_point, "."); - export_row.push(parseFloat(tmp2)); - } - else { - export_row.push(text.trim()); - } + export_row.push(text); } - }); - export_rows.push(export_row); - } - } - }); - $.blockUI(); + } + }); + export_rows.push(export_row); + }); + } view.session.get_file({ url: '/web/export/xls_view', data: {data: JSON.stringify({ From 5be4d84cacfc6b46c353e945bc7670842d46221f Mon Sep 17 00:00:00 2001 From: JBF91 Date: Tue, 14 Nov 2017 13:03:25 +0100 Subject: [PATCH 19/32] [MIG] web_export_view: Migration to 11.0 --- web_export_view/README.rst | 1 + web_export_view/__manifest__.py | 5 ++-- web_export_view/controllers/__init__.py | 2 -- web_export_view/controllers/controllers.py | 1 - .../static/src/js/web_export_view.js | 24 +++++++++++-------- 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/web_export_view/README.rst b/web_export_view/README.rst index 4f765987..7bf25d2a 100644 --- a/web_export_view/README.rst +++ b/web_export_view/README.rst @@ -59,6 +59,7 @@ Contributors * Lorenzo Battistini * Stefan Rijnhart * Leonardo Pistone + * Jose Maria Bernet Maintainer ---------- diff --git a/web_export_view/__manifest__.py b/web_export_view/__manifest__.py index 2281d685..a70928b1 100644 --- a/web_export_view/__manifest__.py +++ b/web_export_view/__manifest__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2016 Henry Zhou (http://www.maxodoo.com) # Copyright 2016 Rodney (http://clearcorp.cr/) # Copyright 2012 Agile Business Group @@ -8,11 +7,11 @@ { 'name': 'Web Export Current View', - 'version': '10.0.1.0.0', + 'version': '11.0.1.0.0', 'category': 'Web', 'author': 'Henry Zhou, Agile Business Group, \ Odoo Community Association (OCA)', - 'website': 'http://www.agilebg.com', + 'website': 'https://github.com/OCA/web', 'license': 'AGPL-3', 'depends': [ 'web', diff --git a/web_export_view/controllers/__init__.py b/web_export_view/controllers/__init__.py index b0f26a9a..e046e49f 100644 --- a/web_export_view/controllers/__init__.py +++ b/web_export_view/controllers/__init__.py @@ -1,3 +1 @@ -# -*- coding: utf-8 -*- - from . import controllers diff --git a/web_export_view/controllers/controllers.py b/web_export_view/controllers/controllers.py index 090a96de..fed05996 100644 --- a/web_export_view/controllers/controllers.py +++ b/web_export_view/controllers/controllers.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2016 Henry Zhou (http://www.maxodoo.com) # Copyright 2016 Rodney (http://clearcorp.cr/) # Copyright 2012 Agile Business Group 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 3b4fb0bc..3e49e310 100644 --- a/web_export_view/static/src/js/web_export_view.js +++ b/web_export_view/static/src/js/web_export_view.js @@ -3,16 +3,18 @@ odoo.define('web_export_view', function (require) { var core = require('web.core'); var Sidebar = require('web.Sidebar'); + var session = require('web.session'); + var QWeb = core.qweb; var _t = core._t; Sidebar.include({ - redraw: function () { + _redraw: function () { var self = this; this._super.apply(this, arguments); - if (self.getParent().ViewManager.active_view.type == 'list') { + if (self.getParent().renderer.viewType == 'list') { self.$el.find('.o_dropdown').last().append(QWeb.render('WebExportTreeViewXls', {widget: self})); self.$el.find('.export_treeview_xls').on('click', self.on_sidebar_export_treeview_xls); } @@ -39,23 +41,25 @@ odoo.define('web_export_view', function (require) { } var export_columns_keys = []; var export_columns_names = []; - $.each(view.visible_columns, function () { - if (this.tag == 'field' && (this.widget === undefined || this.widget != 'handle')) { + var column_index = 0; + $.each(view.renderer.columns, function () { + if (this.tag == 'field' && (this.attrs.widget === undefined || this.attrs.widget != 'handle')) { // non-fields like `_group` or buttons - export_columns_keys.push(this.id); - export_columns_names.push(this.string); + export_columns_keys.push(column_index); + export_columns_names.push(view.$el.find('.o_list_view > thead > tr> th[title]:eq('+column_index+')')[0].textContent); } + column_index ++; }); var export_rows = []; $.blockUI(); if (children) { // find only rows with data - view.$el.find('.o_list_view > tbody > tr[data-id]:has(.o_list_record_selector input:checkbox:checked)') + view.$el.find('.o_list_view > tbody > tr.o_data_row:has(.o_list_record_selector input:checkbox:checked)') .each(function () { var $row = $(this); var export_row = []; $.each(export_columns_keys, function () { - var $cell = $row.find('td[data-field="' + this + '"]') + var $cell = $row.find('td.o_data_cell:eq('+this+')') var $cellcheckbox = $cell.find('.o_checkbox input:checkbox'); if ($cellcheckbox.length) { export_row.push( @@ -85,10 +89,10 @@ odoo.define('web_export_view', function (require) { export_rows.push(export_row); }); } - view.session.get_file({ + session.get_file({ url: '/web/export/xls_view', data: {data: JSON.stringify({ - model: view.model, + model: view.modelName, headers: export_columns_names, rows: export_rows })}, From 4a7f6c23bc7a078413081805cc40beb305e52f1e Mon Sep 17 00:00:00 2001 From: Benjamin Willig Date: Thu, 17 May 2018 14:37:54 +0200 Subject: [PATCH 20/32] [FIX] web_export_view: Several things: * Retrieve all columns even if they are not sortable. Prevent to get select record column * Prevent to process float time numbers as real numbers during the export --- web_export_view/static/src/js/web_export_view.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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 3e49e310..f773491c 100644 --- a/web_export_view/static/src/js/web_export_view.js +++ b/web_export_view/static/src/js/web_export_view.js @@ -42,11 +42,13 @@ odoo.define('web_export_view', function (require) { var export_columns_keys = []; var export_columns_names = []; var column_index = 0; + var column_header_selector; $.each(view.renderer.columns, function () { if (this.tag == 'field' && (this.attrs.widget === undefined || this.attrs.widget != 'handle')) { // non-fields like `_group` or buttons export_columns_keys.push(column_index); - export_columns_names.push(view.$el.find('.o_list_view > thead > tr> th[title]:eq('+column_index+')')[0].textContent); + column_header_selector = '.o_list_view > thead > tr> th:not([class*="o_list_record_selector"]):eq('+column_index+')'; + export_columns_names.push(view.$el.find(column_header_selector)[0].textContent); } column_index ++; }); @@ -69,7 +71,11 @@ odoo.define('web_export_view', function (require) { } else { var text = $cell.text().trim(); - if ($cell.hasClass("o_list_number")) { + var is_number = ( + $cell.hasClass('o_list_number') && + !$cell.hasClass('o_float_time_cell') + ); + if (is_number) { export_row.push(parseFloat( text // Remove thousands separator @@ -80,8 +86,7 @@ odoo.define('web_export_view', function (require) { // Remove non-numeric characters .replace(/[^\d\.-]/g, "") )); - } - else { + } else { export_row.push(text); } } From 5f78816456f13a15953638786df5187c17067442 Mon Sep 17 00:00:00 2001 From: Jose Maria Bernet Date: Mon, 9 Jul 2018 08:53:14 +0200 Subject: [PATCH 21/32] [ADD] Crash Manager --- web_export_view/README.rst | 2 +- web_export_view/static/src/js/web_export_view.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/web_export_view/README.rst b/web_export_view/README.rst index 7bf25d2a..f510e845 100644 --- a/web_export_view/README.rst +++ b/web_export_view/README.rst @@ -59,7 +59,7 @@ Contributors * Lorenzo Battistini * Stefan Rijnhart * Leonardo Pistone - * Jose Maria Bernet + * Jose Maria Bernet Maintainer ---------- 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 f773491c..5f6d4bd0 100644 --- a/web_export_view/static/src/js/web_export_view.js +++ b/web_export_view/static/src/js/web_export_view.js @@ -4,6 +4,7 @@ odoo.define('web_export_view', function (require) { var core = require('web.core'); var Sidebar = require('web.Sidebar'); var session = require('web.session'); + var crash_manager = require('web.crash_manager'); var QWeb = core.qweb; @@ -26,6 +27,8 @@ odoo.define('web_export_view', function (require) { var self = this, view = this.getParent(), children = view.getChildren(); + var c = crash_manager; + if (children) { children.every(function (child) { if (child.field && child.field.type == 'one2many') { @@ -94,6 +97,7 @@ odoo.define('web_export_view', function (require) { export_rows.push(export_row); }); } + session.get_file({ url: '/web/export/xls_view', data: {data: JSON.stringify({ @@ -101,7 +105,8 @@ odoo.define('web_export_view', function (require) { headers: export_columns_names, rows: export_rows })}, - complete: $.unblockUI + complete: $.unblockUI, + error: c.rpc_error.bind(c) }); } From 6d5bea50d594f4b9ba6fe59f7b9014334a311b86 Mon Sep 17 00:00:00 2001 From: oca-travis Date: Wed, 15 Aug 2018 15:32:44 +0000 Subject: [PATCH 22/32] [UPD] Update web_export_view.pot --- web_export_view/i18n/de.po | 8 +++--- web_export_view/i18n/es.po | 8 +++--- web_export_view/i18n/hr.po | 11 ++++---- web_export_view/i18n/nl_NL.po | 11 ++++---- web_export_view/i18n/pt_BR.po | 14 +++++---- web_export_view/i18n/web_export_view.pot | 36 ++++++++++++++++++++++++ web_export_view/i18n/zh_CN.po | 11 ++++---- 7 files changed, 70 insertions(+), 29 deletions(-) create mode 100644 web_export_view/i18n/web_export_view.pot diff --git a/web_export_view/i18n/de.po b/web_export_view/i18n/de.po index 0bc8e4f8..1ba54c51 100644 --- a/web_export_view/i18n/de.po +++ b/web_export_view/i18n/de.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * web_export_view -# +# # Translators: # Niki Waibel , 2017 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2017-04-28 18:03+0000\n" "Last-Translator: Niki Waibel , 2017\n" "Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" +"Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: de\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: web_export_view @@ -27,14 +27,14 @@ msgstr "Exportiere xls" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:63 +#: code:addons/web_export_view/static/src/js/web_export_view.js:72 #, python-format msgid "False" msgstr "Falsch" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:63 +#: code:addons/web_export_view/static/src/js/web_export_view.js:72 #, python-format msgid "True" msgstr "Richtig" diff --git a/web_export_view/i18n/es.po b/web_export_view/i18n/es.po index b2e3decf..e644fd6d 100644 --- a/web_export_view/i18n/es.po +++ b/web_export_view/i18n/es.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * web_export_view -# +# # Translators: # OCA Transbot , 2016 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2017-04-28 18:03+0000\n" "Last-Translator: OCA Transbot , 2016\n" "Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: es\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: web_export_view @@ -27,14 +27,14 @@ msgstr "Exportar XLS" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:63 +#: code:addons/web_export_view/static/src/js/web_export_view.js:72 #, python-format msgid "False" msgstr "Falso" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:63 +#: code:addons/web_export_view/static/src/js/web_export_view.js:72 #, python-format msgid "True" msgstr "Verdadero" diff --git a/web_export_view/i18n/hr.po b/web_export_view/i18n/hr.po index 786e25fd..684bb299 100644 --- a/web_export_view/i18n/hr.po +++ b/web_export_view/i18n/hr.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * web_export_view -# +# # Translators: # Bole , 2017 msgid "" @@ -12,11 +12,12 @@ msgstr "" "PO-Revision-Date: 2017-04-28 18:03+0000\n" "Last-Translator: Bole , 2017\n" "Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" +"Language: hr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: hr\n" -"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" #. module: web_export_view #. openerp-web @@ -27,14 +28,14 @@ msgstr "Izvoz u XLS" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:63 +#: code:addons/web_export_view/static/src/js/web_export_view.js:72 #, python-format msgid "False" msgstr "NE" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:63 +#: code:addons/web_export_view/static/src/js/web_export_view.js:72 #, python-format msgid "True" msgstr "DA" diff --git a/web_export_view/i18n/nl_NL.po b/web_export_view/i18n/nl_NL.po index 6204c697..34674430 100644 --- a/web_export_view/i18n/nl_NL.po +++ b/web_export_view/i18n/nl_NL.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * web_export_view -# +# # Translators: # Peter Hageman , 2017 msgid "" @@ -11,11 +11,12 @@ msgstr "" "POT-Creation-Date: 2017-07-01 03:34+0000\n" "PO-Revision-Date: 2017-07-01 03:34+0000\n" "Last-Translator: Peter Hageman , 2017\n" -"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/teams/23907/nl_NL/)\n" +"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/" +"teams/23907/nl_NL/)\n" +"Language: nl_NL\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: nl_NL\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: web_export_view @@ -27,14 +28,14 @@ msgstr "Exporteer xls" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:63 +#: code:addons/web_export_view/static/src/js/web_export_view.js:72 #, python-format msgid "False" msgstr "Fout" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:63 +#: code:addons/web_export_view/static/src/js/web_export_view.js:72 #, python-format msgid "True" msgstr "Waar" diff --git a/web_export_view/i18n/pt_BR.po b/web_export_view/i18n/pt_BR.po index 08eaaf44..fb317810 100644 --- a/web_export_view/i18n/pt_BR.po +++ b/web_export_view/i18n/pt_BR.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * web_export_view -# +# # Translators: # Rodrigo de Almeida Sottomaior Macedo , 2017 msgid "" @@ -10,12 +10,14 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-06-22 08:26+0000\n" "PO-Revision-Date: 2017-06-22 08:26+0000\n" -"Last-Translator: Rodrigo de Almeida Sottomaior Macedo , 2017\n" -"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/23907/pt_BR/)\n" +"Last-Translator: Rodrigo de Almeida Sottomaior Macedo " +", 2017\n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/" +"teams/23907/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: pt_BR\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: web_export_view @@ -27,14 +29,14 @@ msgstr "Exportar xls" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:63 +#: code:addons/web_export_view/static/src/js/web_export_view.js:72 #, python-format msgid "False" msgstr "Falso" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:63 +#: code:addons/web_export_view/static/src/js/web_export_view.js:72 #, python-format msgid "True" msgstr "Verdadeiro" 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..e48053eb --- /dev/null +++ b/web_export_view/i18n/web_export_view.pot @@ -0,0 +1,36 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_export_view +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/xml/web_export_view_template.xml:6 +#, python-format +msgid "Export xls" +msgstr "" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/js/web_export_view.js:72 +#, python-format +msgid "False" +msgstr "" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/js/web_export_view.js:72 +#, python-format +msgid "True" +msgstr "" + diff --git a/web_export_view/i18n/zh_CN.po b/web_export_view/i18n/zh_CN.po index 63084d07..030c0786 100644 --- a/web_export_view/i18n/zh_CN.po +++ b/web_export_view/i18n/zh_CN.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * web_export_view -# +# # Translators: # OCA Transbot , 2016 msgid "" @@ -11,11 +11,12 @@ msgstr "" "POT-Creation-Date: 2017-04-28 18:03+0000\n" "PO-Revision-Date: 2017-04-28 18:03+0000\n" "Last-Translator: OCA Transbot , 2016\n" -"Language-Team: Chinese (China) (https://www.transifex.com/oca/teams/23907/zh_CN/)\n" +"Language-Team: Chinese (China) (https://www.transifex.com/oca/teams/23907/" +"zh_CN/)\n" +"Language: zh_CN\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: zh_CN\n" "Plural-Forms: nplurals=1; plural=0;\n" #. module: web_export_view @@ -27,14 +28,14 @@ msgstr "导出 xls" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:63 +#: code:addons/web_export_view/static/src/js/web_export_view.js:72 #, python-format msgid "False" msgstr "否" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:63 +#: code:addons/web_export_view/static/src/js/web_export_view.js:72 #, python-format msgid "True" msgstr "是" From b8e7fa3c7ddfe7f6e2fff75fb992848f93b470ee Mon Sep 17 00:00:00 2001 From: Hans Henrik Gabelgaard Date: Sat, 1 Sep 2018 05:04:01 +0000 Subject: [PATCH 23/32] Added translation using Weblate (Danish) --- web_export_view/i18n/da.po | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 web_export_view/i18n/da.po diff --git a/web_export_view/i18n/da.po b/web_export_view/i18n/da.po new file mode 100644 index 00000000..3ec37676 --- /dev/null +++ b/web_export_view/i18n/da.po @@ -0,0 +1,36 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_export_view +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: da\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/xml/web_export_view_template.xml:6 +#, python-format +msgid "Export xls" +msgstr "" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/js/web_export_view.js:72 +#, python-format +msgid "False" +msgstr "" + +#. module: web_export_view +#. openerp-web +#: code:addons/web_export_view/static/src/js/web_export_view.js:72 +#, python-format +msgid "True" +msgstr "" From bd8fd6f3cac390e2711c4e3279a2206a5884a71f Mon Sep 17 00:00:00 2001 From: David Date: Mon, 21 Jan 2019 12:25:19 +0100 Subject: [PATCH 24/32] [11.0] web_export_view: add security group --- web_export_view/README.rst | 6 ++++++ web_export_view/__manifest__.py | 9 ++++++--- web_export_view/security/groups.xml | 9 +++++++++ web_export_view/static/src/js/web_export_view.js | 8 ++++++-- 4 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 web_export_view/security/groups.xml diff --git a/web_export_view/README.rst b/web_export_view/README.rst index f510e845..b87afbf2 100644 --- a/web_export_view/README.rst +++ b/web_export_view/README.rst @@ -16,6 +16,11 @@ A lot of customers want simply to export the tree view they are looking to. If you miss this feature as us, probably you'll find an answer into our web_export_view module. +Configuration +============= + +If we wanted to disallow users to use the features provided by this module, we +can add them to the group *Disallow Export View Data to Excel*. Usage ===== @@ -60,6 +65,7 @@ Contributors * Stefan Rijnhart * Leonardo Pistone * Jose Maria Bernet + * David Vidal Maintainer ---------- diff --git a/web_export_view/__manifest__.py b/web_export_view/__manifest__.py index a70928b1..85541d8d 100644 --- a/web_export_view/__manifest__.py +++ b/web_export_view/__manifest__.py @@ -1,13 +1,14 @@ -# Copyright 2016 Henry Zhou (http://www.maxodoo.com) -# Copyright 2016 Rodney (http://clearcorp.cr/) # Copyright 2012 Agile Business Group # Copyright 2012 Domsense srl () # Copyright 2012 Therp BV +# Copyright 2016 Henry Zhou (http://www.maxodoo.com) +# Copyright 2016 Rodney (http://clearcorp.cr/) +# Copyright 2019 Tecnativa # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { 'name': 'Web Export Current View', - 'version': '11.0.1.0.0', + 'version': '11.0.2.0.0', 'category': 'Web', 'author': 'Henry Zhou, Agile Business Group, \ Odoo Community Association (OCA)', @@ -17,11 +18,13 @@ 'web', ], "data": [ + 'security/groups.xml', 'views/web_export_view_view.xml', ], 'qweb': [ "static/src/xml/web_export_view_template.xml", ], + 'installable': True, 'auto_install': False, } diff --git a/web_export_view/security/groups.xml b/web_export_view/security/groups.xml new file mode 100644 index 00000000..95ad71ed --- /dev/null +++ b/web_export_view/security/groups.xml @@ -0,0 +1,9 @@ + + + + + Disallow Export View Data to Excel + + + + 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 5f6d4bd0..ed49afb1 100644 --- a/web_export_view/static/src/js/web_export_view.js +++ b/web_export_view/static/src/js/web_export_view.js @@ -16,8 +16,12 @@ odoo.define('web_export_view', function (require) { var self = this; this._super.apply(this, arguments); if (self.getParent().renderer.viewType == 'list') { - self.$el.find('.o_dropdown').last().append(QWeb.render('WebExportTreeViewXls', {widget: self})); - self.$el.find('.export_treeview_xls').on('click', self.on_sidebar_export_treeview_xls); + session.user_has_group('web_export_view.group_disallow_export_view_data_excel').then(function (has_group) { + if (!has_group) { + self.$el.find('.o_dropdown').last().append(QWeb.render('WebExportTreeViewXls', { widget: self })); + self.$el.find('.export_treeview_xls').on('click', self.on_sidebar_export_treeview_xls); + } + }); } }, From f6a5b46bd8416232df9a70dd446709be049e899b Mon Sep 17 00:00:00 2001 From: oca-travis Date: Tue, 22 Jan 2019 13:57:36 +0000 Subject: [PATCH 25/32] [UPD] Update web_export_view.pot --- web_export_view/i18n/web_export_view.pot | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/web_export_view/i18n/web_export_view.pot b/web_export_view/i18n/web_export_view.pot index e48053eb..d2e685d0 100644 --- a/web_export_view/i18n/web_export_view.pot +++ b/web_export_view/i18n/web_export_view.pot @@ -13,6 +13,11 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" +#. module: web_export_view +#: model:res.groups,name:web_export_view.group_disallow_export_view_data_excel +msgid "Disallow Export View Data to Excel" +msgstr "" + #. module: web_export_view #. openerp-web #: code:addons/web_export_view/static/src/xml/web_export_view_template.xml:6 @@ -22,14 +27,14 @@ msgstr "" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:72 +#: code:addons/web_export_view/static/src/js/web_export_view.js:76 #, python-format msgid "False" msgstr "" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:72 +#: code:addons/web_export_view/static/src/js/web_export_view.js:76 #, python-format msgid "True" msgstr "" From dce6b9cca51bbf22fcddda85d83bcd6e6f30d7f5 Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Tue, 22 Jan 2019 13:57:50 +0000 Subject: [PATCH 26/32] Update translation files Updated by Update PO files to match POT (msgmerge) hook in Weblate. --- web_export_view/i18n/da.po | 11 ++++++++--- web_export_view/i18n/de.po | 9 +++++++-- web_export_view/i18n/es.po | 9 +++++++-- web_export_view/i18n/hr.po | 9 +++++++-- web_export_view/i18n/nl_NL.po | 9 +++++++-- web_export_view/i18n/pt_BR.po | 9 +++++++-- web_export_view/i18n/zh_CN.po | 9 +++++++-- 7 files changed, 50 insertions(+), 15 deletions(-) diff --git a/web_export_view/i18n/da.po b/web_export_view/i18n/da.po index 3ec37676..a53fadbc 100644 --- a/web_export_view/i18n/da.po +++ b/web_export_view/i18n/da.po @@ -1,6 +1,6 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * web_export_view +# * web_export_view # msgid "" msgstr "" @@ -14,6 +14,11 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n != 1;\n" +#. module: web_export_view +#: model:res.groups,name:web_export_view.group_disallow_export_view_data_excel +msgid "Disallow Export View Data to Excel" +msgstr "" + #. module: web_export_view #. openerp-web #: code:addons/web_export_view/static/src/xml/web_export_view_template.xml:6 @@ -23,14 +28,14 @@ msgstr "" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:72 +#: code:addons/web_export_view/static/src/js/web_export_view.js:76 #, python-format msgid "False" msgstr "" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:72 +#: code:addons/web_export_view/static/src/js/web_export_view.js:76 #, python-format msgid "True" msgstr "" diff --git a/web_export_view/i18n/de.po b/web_export_view/i18n/de.po index 1ba54c51..13685e18 100644 --- a/web_export_view/i18n/de.po +++ b/web_export_view/i18n/de.po @@ -18,6 +18,11 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +#. module: web_export_view +#: model:res.groups,name:web_export_view.group_disallow_export_view_data_excel +msgid "Disallow Export View Data to Excel" +msgstr "" + #. module: web_export_view #. openerp-web #: code:addons/web_export_view/static/src/xml/web_export_view_template.xml:6 @@ -27,14 +32,14 @@ msgstr "Exportiere xls" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:72 +#: code:addons/web_export_view/static/src/js/web_export_view.js:76 #, python-format msgid "False" msgstr "Falsch" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:72 +#: code:addons/web_export_view/static/src/js/web_export_view.js:76 #, python-format msgid "True" msgstr "Richtig" diff --git a/web_export_view/i18n/es.po b/web_export_view/i18n/es.po index e644fd6d..665d3ca0 100644 --- a/web_export_view/i18n/es.po +++ b/web_export_view/i18n/es.po @@ -18,6 +18,11 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +#. module: web_export_view +#: model:res.groups,name:web_export_view.group_disallow_export_view_data_excel +msgid "Disallow Export View Data to Excel" +msgstr "" + #. module: web_export_view #. openerp-web #: code:addons/web_export_view/static/src/xml/web_export_view_template.xml:6 @@ -27,14 +32,14 @@ msgstr "Exportar XLS" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:72 +#: code:addons/web_export_view/static/src/js/web_export_view.js:76 #, python-format msgid "False" msgstr "Falso" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:72 +#: code:addons/web_export_view/static/src/js/web_export_view.js:76 #, python-format msgid "True" msgstr "Verdadero" diff --git a/web_export_view/i18n/hr.po b/web_export_view/i18n/hr.po index 684bb299..09cf7132 100644 --- a/web_export_view/i18n/hr.po +++ b/web_export_view/i18n/hr.po @@ -19,6 +19,11 @@ msgstr "" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +#. module: web_export_view +#: model:res.groups,name:web_export_view.group_disallow_export_view_data_excel +msgid "Disallow Export View Data to Excel" +msgstr "" + #. module: web_export_view #. openerp-web #: code:addons/web_export_view/static/src/xml/web_export_view_template.xml:6 @@ -28,14 +33,14 @@ msgstr "Izvoz u XLS" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:72 +#: code:addons/web_export_view/static/src/js/web_export_view.js:76 #, python-format msgid "False" msgstr "NE" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:72 +#: code:addons/web_export_view/static/src/js/web_export_view.js:76 #, python-format msgid "True" msgstr "DA" diff --git a/web_export_view/i18n/nl_NL.po b/web_export_view/i18n/nl_NL.po index 34674430..01cda3da 100644 --- a/web_export_view/i18n/nl_NL.po +++ b/web_export_view/i18n/nl_NL.po @@ -19,6 +19,11 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +#. module: web_export_view +#: model:res.groups,name:web_export_view.group_disallow_export_view_data_excel +msgid "Disallow Export View Data to Excel" +msgstr "" + #. module: web_export_view #. openerp-web #: code:addons/web_export_view/static/src/xml/web_export_view_template.xml:6 @@ -28,14 +33,14 @@ msgstr "Exporteer xls" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:72 +#: code:addons/web_export_view/static/src/js/web_export_view.js:76 #, python-format msgid "False" msgstr "Fout" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:72 +#: code:addons/web_export_view/static/src/js/web_export_view.js:76 #, python-format msgid "True" msgstr "Waar" diff --git a/web_export_view/i18n/pt_BR.po b/web_export_view/i18n/pt_BR.po index fb317810..a6260684 100644 --- a/web_export_view/i18n/pt_BR.po +++ b/web_export_view/i18n/pt_BR.po @@ -20,6 +20,11 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +#. module: web_export_view +#: model:res.groups,name:web_export_view.group_disallow_export_view_data_excel +msgid "Disallow Export View Data to Excel" +msgstr "" + #. module: web_export_view #. openerp-web #: code:addons/web_export_view/static/src/xml/web_export_view_template.xml:6 @@ -29,14 +34,14 @@ msgstr "Exportar xls" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:72 +#: code:addons/web_export_view/static/src/js/web_export_view.js:76 #, python-format msgid "False" msgstr "Falso" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:72 +#: code:addons/web_export_view/static/src/js/web_export_view.js:76 #, python-format msgid "True" msgstr "Verdadeiro" diff --git a/web_export_view/i18n/zh_CN.po b/web_export_view/i18n/zh_CN.po index 030c0786..1d262714 100644 --- a/web_export_view/i18n/zh_CN.po +++ b/web_export_view/i18n/zh_CN.po @@ -19,6 +19,11 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=1; plural=0;\n" +#. module: web_export_view +#: model:res.groups,name:web_export_view.group_disallow_export_view_data_excel +msgid "Disallow Export View Data to Excel" +msgstr "" + #. module: web_export_view #. openerp-web #: code:addons/web_export_view/static/src/xml/web_export_view_template.xml:6 @@ -28,14 +33,14 @@ msgstr "导出 xls" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:72 +#: code:addons/web_export_view/static/src/js/web_export_view.js:76 #, python-format msgid "False" msgstr "否" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:72 +#: code:addons/web_export_view/static/src/js/web_export_view.js:76 #, python-format msgid "True" msgstr "是" From 81832b05e54d0f3edc9e21fa200e41856e0b030d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20D=C3=ADaz?= Date: Tue, 9 Apr 2019 02:35:32 +0200 Subject: [PATCH 27/32] [11.0][FIX] web_export_view: Issue #1099 --- web_export_view/static/src/js/web_export_view.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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 ed49afb1..dfce0ef2 100644 --- a/web_export_view/static/src/js/web_export_view.js +++ b/web_export_view/static/src/js/web_export_view.js @@ -49,15 +49,18 @@ odoo.define('web_export_view', function (require) { var export_columns_keys = []; var export_columns_names = []; var column_index = 0; - var column_header_selector; + var column_header_selector = ''; + var isGrouped = view.renderer.state.groupedBy.length > 0; $.each(view.renderer.columns, function () { if (this.tag == 'field' && (this.attrs.widget === undefined || this.attrs.widget != 'handle')) { // non-fields like `_group` or buttons export_columns_keys.push(column_index); - column_header_selector = '.o_list_view > thead > tr> th:not([class*="o_list_record_selector"]):eq('+column_index+')'; + var css_selector_index = isGrouped + ? column_index+1 : column_index; + column_header_selector = '.o_list_view > thead > tr> th:not([class*="o_list_record_selector"]):eq('+css_selector_index+')'; export_columns_names.push(view.$el.find(column_header_selector)[0].textContent); } - column_index ++; + ++column_index; }); var export_rows = []; $.blockUI(); From 87fc33e91ae08ae7d77bc1c5f55b95ad04167d7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20D=C3=ADaz?= Date: Tue, 9 Apr 2019 02:41:06 +0200 Subject: [PATCH 28/32] [11.0][IMP] web_export_view: Split readme --- web_export_view/readme/CONFIGURATION.rst | 2 ++ web_export_view/readme/CONTRIBUTORS.rst | 9 +++++++++ web_export_view/readme/DESCRIPTION.rst | 11 +++++++++++ web_export_view/readme/ROADMAP.rst | 9 +++++++++ web_export_view/readme/USAGE.rst | 3 +++ 5 files changed, 34 insertions(+) create mode 100644 web_export_view/readme/CONFIGURATION.rst create mode 100644 web_export_view/readme/CONTRIBUTORS.rst create mode 100644 web_export_view/readme/DESCRIPTION.rst create mode 100644 web_export_view/readme/ROADMAP.rst create mode 100644 web_export_view/readme/USAGE.rst diff --git a/web_export_view/readme/CONFIGURATION.rst b/web_export_view/readme/CONFIGURATION.rst new file mode 100644 index 00000000..3ae2e649 --- /dev/null +++ b/web_export_view/readme/CONFIGURATION.rst @@ -0,0 +1,2 @@ +If we wanted to disallow users to use the features provided by this module, we +can add them to the group *Disallow Export View Data to Excel*. \ No newline at end of file diff --git a/web_export_view/readme/CONTRIBUTORS.rst b/web_export_view/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..67e4e410 --- /dev/null +++ b/web_export_view/readme/CONTRIBUTORS.rst @@ -0,0 +1,9 @@ +* Henry Zhou (MAXodoo) +* Rodney +* Simone Orsi +* Lorenzo Battistini +* Stefan Rijnhart +* Leonardo Pistone +* Jose Maria Bernet +* David Vidal +* Alexandre Díaz diff --git a/web_export_view/readme/DESCRIPTION.rst b/web_export_view/readme/DESCRIPTION.rst new file mode 100644 index 00000000..3cd7aa3e --- /dev/null +++ b/web_export_view/readme/DESCRIPTION.rst @@ -0,0 +1,11 @@ +One of the best Odoo's features is exporting custom data to CSV/XLS. You can +do it by clicking on the export link in the sidebar. The export action allows +us to configure what to be exported by selecting fields, etc, and allows you +to save your export as a template so that you can export it once again without +having to configure it again. + +That feature is as great and advanced as limited for an everyday experience. +A lot of customers want simply to export the tree view they are looking to. + +If you miss this feature as us, probably you'll find an answer into our +web_export_view module. diff --git a/web_export_view/readme/ROADMAP.rst b/web_export_view/readme/ROADMAP.rst new file mode 100644 index 00000000..05d17110 --- /dev/null +++ b/web_export_view/readme/ROADMAP.rst @@ -0,0 +1,9 @@ +Pedro M. Baeza (pedro.baeza@tecnativa.com): +When you have groups, they are not exported to Excel. It would be desirable to have this option. +One of the problems with this module is that you can't export data from a view with mode="tree". +Changing the approach to have the button always visible (we should relocate it also to another place, +as the current location is not visible for these views), and digging correctly in the DOM elements +for this view (very similar to the normal tree view one) will do the trick. This will also help users +to locate the feature, as it's hidden now by default and users don't think about selecting records. +The behavior will be: nothing selected > you export all (including groups). +Something or all selected: export the selection. diff --git a/web_export_view/readme/USAGE.rst b/web_export_view/readme/USAGE.rst new file mode 100644 index 00000000..45613441 --- /dev/null +++ b/web_export_view/readme/USAGE.rst @@ -0,0 +1,3 @@ +After you installed it, you'll find an additional link 'Export current view' +right on the sidebar. By clicking on it you'll get a XLS file contains +the same data of the tree view you are looking at, headers included. From 99816c7d31433ebc98641f7817cd9283390043b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20D=C3=ADaz?= Date: Tue, 9 Apr 2019 02:41:45 +0200 Subject: [PATCH 29/32] [11.0][IMP] web_export_view: Linter --- .../static/src/js/web_export_view.js | 134 ++++++++++-------- 1 file changed, 74 insertions(+), 60 deletions(-) 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 dfce0ef2..47e82135 100644 --- a/web_export_view/static/src/js/web_export_view.js +++ b/web_export_view/static/src/js/web_export_view.js @@ -1,5 +1,5 @@ odoo.define('web_export_view', function (require) { -"use strict"; + "use strict"; var core = require('web.core'); var Sidebar = require('web.Sidebar'); @@ -15,33 +15,37 @@ odoo.define('web_export_view', function (require) { _redraw: function () { var self = this; this._super.apply(this, arguments); - if (self.getParent().renderer.viewType == 'list') { - session.user_has_group('web_export_view.group_disallow_export_view_data_excel').then(function (has_group) { - if (!has_group) { - self.$el.find('.o_dropdown').last().append(QWeb.render('WebExportTreeViewXls', { widget: self })); - self.$el.find('.export_treeview_xls').on('click', self.on_sidebar_export_treeview_xls); - } - }); + if (self.getParent().renderer.viewType === 'list') { + session.user_has_group( + 'web_export_view.group_disallow_export_view_data_excel') + .then(function (has_group) { + if (!has_group) { + self.$el.find('.o_dropdown') + .last().append(QWeb.render( + 'WebExportTreeViewXls', {widget: self})); + self.$el.find('.export_treeview_xls').on('click', + self.on_sidebar_export_treeview_xls); + } + }); } }, on_sidebar_export_treeview_xls: function () { // 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(), + var view = this.getParent(), children = view.getChildren(); var c = crash_manager; if (children) { children.every(function (child) { - if (child.field && child.field.type == 'one2many') { + if (child.field && child.field.type === 'one2many') { view = child.viewmanager.views.list.controller; - return false; // break out of the loop + return false; } - if (child.field && child.field.type == 'many2many') { + if (child.field && child.field.type === 'many2many') { view = child.list_view; - return false; // break out of the loop + return false; } return true; }); @@ -52,70 +56,80 @@ odoo.define('web_export_view', function (require) { var column_header_selector = ''; var isGrouped = view.renderer.state.groupedBy.length > 0; $.each(view.renderer.columns, function () { - if (this.tag == 'field' && (this.attrs.widget === undefined || this.attrs.widget != 'handle')) { - // non-fields like `_group` or buttons + if (this.tag === 'field' && + (this.attrs.widget === undefined || + this.attrs.widget !== 'handle')) { export_columns_keys.push(column_index); var css_selector_index = isGrouped ? column_index+1 : column_index; - column_header_selector = '.o_list_view > thead > tr> th:not([class*="o_list_record_selector"]):eq('+css_selector_index+')'; - export_columns_names.push(view.$el.find(column_header_selector)[0].textContent); + column_header_selector = '.o_list_view > thead > tr> ' + + 'th:not([class*="o_list_record_selector"]):eq(' + + css_selector_index + ')'; + export_columns_names.push( + view.$el.find(column_header_selector)[0].textContent); } ++column_index; }); var export_rows = []; $.blockUI(); if (children) { - // find only rows with data - view.$el.find('.o_list_view > tbody > tr.o_data_row:has(.o_list_record_selector input:checkbox:checked)') - .each(function () { - var $row = $(this); - var export_row = []; - $.each(export_columns_keys, function () { - var $cell = $row.find('td.o_data_cell:eq('+this+')') - var $cellcheckbox = $cell.find('.o_checkbox input:checkbox'); - if ($cellcheckbox.length) { - export_row.push( - $cellcheckbox.is(":checked") - ? _t("True") : _t("False") - ); - } - else { - var text = $cell.text().trim(); - var is_number = ( - $cell.hasClass('o_list_number') && - !$cell.hasClass('o_float_time_cell') - ); - if (is_number) { - export_row.push(parseFloat( - text - // Remove thousands separator - .split(_t.database.parameters.thousands_sep) - .join("") - // Always use a `.` as decimal separator - .replace(_t.database.parameters.decimal_point, ".") - // Remove non-numeric characters - .replace(/[^\d\.-]/g, "") - )); + // Find only rows with data + view.$el.find('.o_list_view > tbody > tr.o_data_row:' + + 'has(.o_list_record_selector input:checkbox:checked)') + .each(function () { + var $row = $(this); + var export_row = []; + $.each(export_columns_keys, function () { + var $cell = $row.find( + 'td.o_data_cell:eq('+this+')'); + var $cellcheckbox = $cell.find( + '.o_checkbox input:checkbox'); + if ($cellcheckbox.length) { + export_row.push( + $cellcheckbox.is(":checked") + ? _t("True") : _t("False") + ); } else { - export_row.push(text); + var text = $cell.text().trim(); + var is_number = + $cell.hasClass('o_list_number') && + !$cell.hasClass('o_float_time_cell'); + if (is_number) { + var db_params = _t.database.parameters; + export_row.push(parseFloat( + text + // Remove thousands separator + .split(db_params.thousands_sep) + .join("") + // Always use a `.` as decimal + // separator + .replace(db_params.decimal_point, + ".") + // Remove non-numeric characters + .replace(/[^\d.-]/g, "") + )); + } else { + export_row.push(text); + } } - } + }); + export_rows.push(export_row); }); - export_rows.push(export_row); - }); } session.get_file({ url: '/web/export/xls_view', - data: {data: JSON.stringify({ - model: view.modelName, - headers: export_columns_names, - rows: export_rows - })}, + data: { + data: JSON.stringify({ + model: view.modelName, + headers: export_columns_names, + rows: export_rows, + }), + }, complete: $.unblockUI, - error: c.rpc_error.bind(c) + error: c.rpc_error.bind(c), }); - } + }, }); }); From 8d0c5507fb28215edcebf4acaa5f7cc73635ee4b Mon Sep 17 00:00:00 2001 From: oca-travis Date: Thu, 25 Apr 2019 10:13:55 +0000 Subject: [PATCH 30/32] [UPD] Update web_export_view.pot --- web_export_view/i18n/web_export_view.pot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web_export_view/i18n/web_export_view.pot b/web_export_view/i18n/web_export_view.pot index d2e685d0..b626484a 100644 --- a/web_export_view/i18n/web_export_view.pot +++ b/web_export_view/i18n/web_export_view.pot @@ -27,14 +27,14 @@ msgstr "" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:76 +#: code:addons/web_export_view/static/src/js/web_export_view.js:90 #, python-format msgid "False" msgstr "" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:76 +#: code:addons/web_export_view/static/src/js/web_export_view.js:90 #, python-format msgid "True" msgstr "" From f9c86d2d814d65bcb6e8d71e0af6335b3da3deee Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Thu, 25 Apr 2019 10:14:12 +0000 Subject: [PATCH 31/32] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: web-11.0/web-11.0-web_export_view Translate-URL: https://translation.odoo-community.org/projects/web-11-0/web-11-0-web_export_view/ --- web_export_view/i18n/da.po | 4 ++-- web_export_view/i18n/de.po | 4 ++-- web_export_view/i18n/es.po | 4 ++-- web_export_view/i18n/hr.po | 4 ++-- web_export_view/i18n/nl_NL.po | 4 ++-- web_export_view/i18n/pt_BR.po | 4 ++-- web_export_view/i18n/zh_CN.po | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/web_export_view/i18n/da.po b/web_export_view/i18n/da.po index a53fadbc..b29f4cbf 100644 --- a/web_export_view/i18n/da.po +++ b/web_export_view/i18n/da.po @@ -28,14 +28,14 @@ msgstr "" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:76 +#: code:addons/web_export_view/static/src/js/web_export_view.js:90 #, python-format msgid "False" msgstr "" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:76 +#: code:addons/web_export_view/static/src/js/web_export_view.js:90 #, python-format msgid "True" msgstr "" diff --git a/web_export_view/i18n/de.po b/web_export_view/i18n/de.po index 13685e18..f802b201 100644 --- a/web_export_view/i18n/de.po +++ b/web_export_view/i18n/de.po @@ -32,14 +32,14 @@ msgstr "Exportiere xls" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:76 +#: code:addons/web_export_view/static/src/js/web_export_view.js:90 #, python-format msgid "False" msgstr "Falsch" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:76 +#: code:addons/web_export_view/static/src/js/web_export_view.js:90 #, python-format msgid "True" msgstr "Richtig" diff --git a/web_export_view/i18n/es.po b/web_export_view/i18n/es.po index 665d3ca0..d05b0ef4 100644 --- a/web_export_view/i18n/es.po +++ b/web_export_view/i18n/es.po @@ -32,14 +32,14 @@ msgstr "Exportar XLS" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:76 +#: code:addons/web_export_view/static/src/js/web_export_view.js:90 #, python-format msgid "False" msgstr "Falso" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:76 +#: code:addons/web_export_view/static/src/js/web_export_view.js:90 #, python-format msgid "True" msgstr "Verdadero" diff --git a/web_export_view/i18n/hr.po b/web_export_view/i18n/hr.po index 09cf7132..46301112 100644 --- a/web_export_view/i18n/hr.po +++ b/web_export_view/i18n/hr.po @@ -33,14 +33,14 @@ msgstr "Izvoz u XLS" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:76 +#: code:addons/web_export_view/static/src/js/web_export_view.js:90 #, python-format msgid "False" msgstr "NE" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:76 +#: code:addons/web_export_view/static/src/js/web_export_view.js:90 #, python-format msgid "True" msgstr "DA" diff --git a/web_export_view/i18n/nl_NL.po b/web_export_view/i18n/nl_NL.po index 01cda3da..719c5d80 100644 --- a/web_export_view/i18n/nl_NL.po +++ b/web_export_view/i18n/nl_NL.po @@ -33,14 +33,14 @@ msgstr "Exporteer xls" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:76 +#: code:addons/web_export_view/static/src/js/web_export_view.js:90 #, python-format msgid "False" msgstr "Fout" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:76 +#: code:addons/web_export_view/static/src/js/web_export_view.js:90 #, python-format msgid "True" msgstr "Waar" diff --git a/web_export_view/i18n/pt_BR.po b/web_export_view/i18n/pt_BR.po index a6260684..cfe2c992 100644 --- a/web_export_view/i18n/pt_BR.po +++ b/web_export_view/i18n/pt_BR.po @@ -34,14 +34,14 @@ msgstr "Exportar xls" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:76 +#: code:addons/web_export_view/static/src/js/web_export_view.js:90 #, python-format msgid "False" msgstr "Falso" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:76 +#: code:addons/web_export_view/static/src/js/web_export_view.js:90 #, python-format msgid "True" msgstr "Verdadeiro" diff --git a/web_export_view/i18n/zh_CN.po b/web_export_view/i18n/zh_CN.po index 1d262714..ebf289c9 100644 --- a/web_export_view/i18n/zh_CN.po +++ b/web_export_view/i18n/zh_CN.po @@ -33,14 +33,14 @@ msgstr "导出 xls" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:76 +#: code:addons/web_export_view/static/src/js/web_export_view.js:90 #, python-format msgid "False" msgstr "否" #. module: web_export_view #. openerp-web -#: code:addons/web_export_view/static/src/js/web_export_view.js:76 +#: code:addons/web_export_view/static/src/js/web_export_view.js:90 #, python-format msgid "True" msgstr "是" From 2aa90d240d4187423b79db05e8a4de372e545db0 Mon Sep 17 00:00:00 2001 From: Valtteri Lattu Date: Wed, 3 Apr 2019 10:50:13 +0300 Subject: [PATCH 32/32] [MIG] web_export_view: Migration to 12.0 --- web_export_view/README.rst | 101 ++- web_export_view/__init__.py | 2 - web_export_view/__manifest__.py | 2 +- web_export_view/readme/CONFIGURE.rst | 2 + web_export_view/readme/CONTRIBUTORS.rst | 6 +- web_export_view/static/description/index.html | 653 ++++++++++++++++++ .../static/src/js/web_export_view.js | 10 +- 7 files changed, 736 insertions(+), 40 deletions(-) create mode 100644 web_export_view/readme/CONFIGURE.rst create mode 100644 web_export_view/static/description/index.html diff --git a/web_export_view/README.rst b/web_export_view/README.rst index b87afbf2..e9872121 100644 --- a/web_export_view/README.rst +++ b/web_export_view/README.rst @@ -1,8 +1,29 @@ -.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :alt: License - -Export Current View -=================== +======================= +Web Export Current View +======================= + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github + :target: https://github.com/OCA/web/tree/12.0/web_export_view + :alt: OCA/web +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/web-12-0/web-12-0-web_export_view + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/162/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| One of the best Odoo's features is exporting custom data to CSV/XLS. You can do it by clicking on the export link in the sidebar. The export action allows @@ -16,6 +37,11 @@ A lot of customers want simply to export the tree view they are looking to. If you miss this feature as us, probably you'll find an answer into our web_export_view module. +**Table of contents** + +.. contents:: + :local: + Configuration ============= @@ -29,11 +55,10 @@ After you installed it, you'll find an additional link 'Export current view' right on the sidebar. By clicking on it you'll get a XLS file contains the same data of the tree view you are looking at, headers included. +Known issues / Roadmap +====================== -Known Issues -============ - -Pedro M. Baeza (pedro.baeza@gmail.com): +Pedro M. Baeza (pedro.baeza@tecnativa.com): When you have groups, they are not exported to Excel. It would be desirable to have this option. One of the problems with this module is that you can't export data from a view with mode="tree". Changing the approach to have the button always visible (we should relocate it also to another place, @@ -43,39 +68,55 @@ to locate the feature, as it's hidden now by default and users don't think about The behavior will be: nothing selected > you export all (including groups). Something or all selected: export the selection. - Bug Tracker =========== -Bugs are tracked on `GitHub Issues -`_. In case of trouble, please -check there if your issue has already been reported. If you spotted it first, -help us smashing it by providing a detailed and welcomed feedback. +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. Credits ======= +Authors +~~~~~~~ + +* Henry Zhou +* Agile Business Group + Contributors ------------- +~~~~~~~~~~~~ - * Henry Zhou (MAXodoo) - * Rodney - * Simone Orsi - * Lorenzo Battistini - * Stefan Rijnhart - * Leonardo Pistone - * Jose Maria Bernet - * David Vidal +* Henry Zhou (MAXodoo) +* Rodney +* Simone Orsi +* Lorenzo Battistini +* Stefan Rijnhart +* Leonardo Pistone +* Jose Maria Bernet +* Alexandre Díaz +* Valtteri Lattu +* `Tecnativa `_: -Maintainer ----------- + * David Vidal + * Ernesto Tejeda -.. image:: http://odoo-community.org/logo.png - :alt: Odoo Community Association - :target: http://odoo-community.org +Maintainers +~~~~~~~~~~~ This module is maintained by the OCA. -OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +This module is part of the `OCA/web `_ project on GitHub. -To contribute to this module, please visit http://odoo-community.org. +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/web_export_view/__init__.py b/web_export_view/__init__.py index b0f26a9a..e046e49f 100644 --- a/web_export_view/__init__.py +++ b/web_export_view/__init__.py @@ -1,3 +1 @@ -# -*- coding: utf-8 -*- - from . import controllers diff --git a/web_export_view/__manifest__.py b/web_export_view/__manifest__.py index 85541d8d..bd86c043 100644 --- a/web_export_view/__manifest__.py +++ b/web_export_view/__manifest__.py @@ -8,7 +8,7 @@ { 'name': 'Web Export Current View', - 'version': '11.0.2.0.0', + 'version': '12.0.1.0.0', 'category': 'Web', 'author': 'Henry Zhou, Agile Business Group, \ Odoo Community Association (OCA)', diff --git a/web_export_view/readme/CONFIGURE.rst b/web_export_view/readme/CONFIGURE.rst new file mode 100644 index 00000000..3ae2e649 --- /dev/null +++ b/web_export_view/readme/CONFIGURE.rst @@ -0,0 +1,2 @@ +If we wanted to disallow users to use the features provided by this module, we +can add them to the group *Disallow Export View Data to Excel*. \ No newline at end of file diff --git a/web_export_view/readme/CONTRIBUTORS.rst b/web_export_view/readme/CONTRIBUTORS.rst index 67e4e410..3b71ec42 100644 --- a/web_export_view/readme/CONTRIBUTORS.rst +++ b/web_export_view/readme/CONTRIBUTORS.rst @@ -5,5 +5,9 @@ * Stefan Rijnhart * Leonardo Pistone * Jose Maria Bernet -* David Vidal * Alexandre Díaz +* Valtteri Lattu +* `Tecnativa `_: + + * David Vidal + * Ernesto Tejeda diff --git a/web_export_view/static/description/index.html b/web_export_view/static/description/index.html new file mode 100644 index 00000000..e823ea02 --- /dev/null +++ b/web_export_view/static/description/index.html @@ -0,0 +1,653 @@ + + + + + + + Web Export Current View + + + +
+

Web Export Current View

+ + +

Beta + License: AGPL-3 + OCA/web + Translate me on Weblate + Try me on Runbot +

+

One of the best Odoo’s features is exporting custom data to CSV/XLS. You + can + do it by clicking on the export link in the sidebar. The export action + allows + us to configure what to be exported by selecting fields, etc, and + allows you + to save your export as a template so that you can export it once again + without + having to configure it again.

+

That feature is as great and advanced as limited for an everyday + experience. + A lot of customers want simply to export the tree view they are looking + to.

+

If you miss this feature as us, probably you’ll find an answer into our + web_export_view module.

+

Table of contents

+ +
+

Configuration

+

If we wanted to disallow users to use the features provided by this + module, we + can add them to the group Disallow Export View Data to + Excel.

+
+
+

Usage

+

After you installed it, you’ll find an additional link ‘Export + current view’ + right on the sidebar. By clicking on it you’ll get a XLS file + contains + the same data of the tree view you are looking at, headers + included.

+
+
+

Known issues / Roadmap

+

Pedro M. Baeza (pedro.baeza@tecnativa.com): + When you have groups, they are not exported to Excel. It would be + desirable to have this option. + One of the problems with this module is that you can’t export data + from a view with mode=”tree”. + Changing the approach to have the button always visible (we should + relocate it also to another place, + as the current location is not visible for these views), and + digging correctly in the DOM elements + for this view (very similar to the normal tree view one) will do + the trick. This will also help users + to locate the feature, as it’s hidden now by default and users + don’t think about selecting records. + The behavior will be: nothing selected > you export all + (including groups). + Something or all selected: export the selection.

+
+
+

Bug Tracker

+

Bugs are tracked on GitHub + Issues. + In case of trouble, please check there if your issue has already + been reported. + If you spotted it first, help us smashing it by providing a + detailed and welcomed + feedback. +

+

Do not contact contributors directly about support or help with + technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Henry Zhou
  • +
  • Agile Business Group
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit + organization whose + mission is to support the collaborative development of Odoo + features and + promote its widespread use.

+

This module is part of the OCA/web + project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. +

+
+
+
+ + 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 47e82135..71cc034f 100644 --- a/web_export_view/static/src/js/web_export_view.js +++ b/web_export_view/static/src/js/web_export_view.js @@ -19,9 +19,10 @@ odoo.define('web_export_view', function (require) { session.user_has_group( 'web_export_view.group_disallow_export_view_data_excel') .then(function (has_group) { - if (!has_group) { + var export_btn = self.$el.find('.export_treeview_xls'); + if (!has_group && !export_btn.length) { self.$el.find('.o_dropdown') - .last().append(QWeb.render( + .parent().append(QWeb.render( 'WebExportTreeViewXls', {widget: self})); self.$el.find('.export_treeview_xls').on('click', self.on_sidebar_export_treeview_xls); @@ -54,17 +55,14 @@ odoo.define('web_export_view', function (require) { var export_columns_names = []; var column_index = 0; var column_header_selector = ''; - var isGrouped = view.renderer.state.groupedBy.length > 0; $.each(view.renderer.columns, function () { if (this.tag === 'field' && (this.attrs.widget === undefined || this.attrs.widget !== 'handle')) { export_columns_keys.push(column_index); - var css_selector_index = isGrouped - ? column_index+1 : column_index; column_header_selector = '.o_list_view > thead > tr> ' + 'th:not([class*="o_list_record_selector"]):eq(' + - css_selector_index + ')'; + column_index + ')'; export_columns_names.push( view.$el.find(column_header_selector)[0].textContent); }