diff --git a/web_export_usability/__init__.py b/web_export_usability/__init__.py new file mode 100644 index 0000000..e046e49 --- /dev/null +++ b/web_export_usability/__init__.py @@ -0,0 +1 @@ +from . import controllers diff --git a/web_export_usability/__openerp__.py b/web_export_usability/__openerp__.py new file mode 100644 index 0000000..551d17b --- /dev/null +++ b/web_export_usability/__openerp__.py @@ -0,0 +1,29 @@ +# coding: utf-8 +# © 2017 David BEAL @ Akretion +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +{ + 'name': 'Web Export Usability', + 'version': '8.0.0.1.0', + 'author': 'Akretion', + 'website': 'http://www.akretion.com', + 'category': 'web', + 'description': """ +Override of the module web for export features: + +- set default export format to Excel + + +Roadmap: + +- set default export type to 'Export all data' + +""", + 'depends': ['web'], + 'data': [ + ], + "external_dependencies": { + "python": ['xlwt'], + }, + 'demo': [], + 'installable': True, +} diff --git a/web_export_usability/controllers/__init__.py b/web_export_usability/controllers/__init__.py new file mode 100644 index 0000000..4435ea7 --- /dev/null +++ b/web_export_usability/controllers/__init__.py @@ -0,0 +1 @@ +from . import export diff --git a/web_export_usability/controllers/export.py b/web_export_usability/controllers/export.py new file mode 100644 index 0000000..4f5612a --- /dev/null +++ b/web_export_usability/controllers/export.py @@ -0,0 +1,25 @@ +# coding: utf-8 +# © 2017 David BEAL @ Akretion +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openerp import http +from openerp.addons.web.controllers.main import Export +import logging + +_logger = logging.getLogger(__name__) + + +class Export_(Export): + + @http.route('/web/export/formats', type='json', auth="user") + def formats(self): + """ Returns all valid export formats + + :returns: for each export format, a pair of identifier + and printable name + :rtype: [(str, str)] + """ + response = super(Export_, self).formats() + # put xls, before csv + response.reverse() + return response diff --git a/web_export_usability/static/description/icon.png b/web_export_usability/static/description/icon.png new file mode 100644 index 0000000..24773d2 Binary files /dev/null and b/web_export_usability/static/description/icon.png differ