diff --git a/.void/report_xlsx/README.rst b/report_xlsx/README.rst similarity index 75% rename from .void/report_xlsx/README.rst rename to report_xlsx/README.rst index 99f31b8..d60cf79 100644 --- a/.void/report_xlsx/README.rst +++ b/report_xlsx/README.rst @@ -2,14 +2,17 @@ Base report xlsx ================ -.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:2fc013e13757e08aaf4dc870f58478e89c53e80c12ed89cd44cdac0d351f34b3 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png +.. |badge1| image:: https://img.shields.io/badge/maturity-Mature-brightgreen.png :target: https://odoo-community.org/page/development-status - :alt: Production/Stable + :alt: Mature .. |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 @@ -19,11 +22,11 @@ Base report xlsx .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png :target: https://translation.odoo-community.org/projects/reporting-engine-15-0/reporting-engine-15-0-report_xlsx :alt: Translate me on Weblate -.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/143/15.0 - :alt: Try me on Runbot +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/reporting-engine&target_branch=15.0 + :alt: Try me on Runboat -|badge1| |badge2| |badge3| |badge4| |badge5| +|badge1| |badge2| |badge3| |badge4| |badge5| This module provides a basic report class to generate xlsx report. @@ -69,22 +72,23 @@ To manipulate the ``workbook`` and ``sheet`` objects, refer to the A report XML record :: - + + Print to XLSX + res.partner + xlsx + module_name.report_name + module_name.report_file + + report + + 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 +If you spotted it first, help us to smash it by providing a detailed and welcomed `feedback `_. Do not contact contributors directly about support or help with technical issues. diff --git a/.void/report_xlsx/__init__.py b/report_xlsx/__init__.py similarity index 100% rename from .void/report_xlsx/__init__.py rename to report_xlsx/__init__.py diff --git a/.void/report_xlsx/__manifest__.py b/report_xlsx/__manifest__.py similarity index 81% rename from .void/report_xlsx/__manifest__.py rename to report_xlsx/__manifest__.py index e8b9c0d..3f9c71c 100644 --- a/.void/report_xlsx/__manifest__.py +++ b/report_xlsx/__manifest__.py @@ -6,10 +6,9 @@ "author": "ACSONE SA/NV," "Creu Blanca," "Odoo Community Association (OCA)", "website": "https://github.com/OCA/reporting-engine", "category": "Reporting", - "version": "15.0.1.0.4", - "development_status": "Production/Stable", + "version": "15.0.1.1.5", + "development_status": "Mature", "license": "AGPL-3", - "external_dependencies": {"python": ["xlsxwriter", "xlrd"]}, "depends": ["base", "web"], "demo": ["demo/report.xml"], "installable": True, diff --git a/.void/report_xlsx/controllers/__init__.py b/report_xlsx/controllers/__init__.py similarity index 100% rename from .void/report_xlsx/controllers/__init__.py rename to report_xlsx/controllers/__init__.py diff --git a/.void/report_xlsx/controllers/main.py b/report_xlsx/controllers/main.py similarity index 84% rename from .void/report_xlsx/controllers/main.py rename to report_xlsx/controllers/main.py index a3bd661..ec19218 100644 --- a/.void/report_xlsx/controllers/main.py +++ b/report_xlsx/controllers/main.py @@ -52,8 +52,9 @@ def report_routes(self, reportname, docids=None, converter=None, **data): def report_download(self, data, context=None): requestcontent = json.loads(data) url, report_type = requestcontent[0], requestcontent[1] - try: - if report_type == "xlsx": + if report_type == "xlsx": + reportname = url + try: reportname = url.split("/report/xlsx/")[1].split("?")[0] docids = None if "/" in reportname: @@ -90,14 +91,14 @@ def report_download(self, data, context=None): report.print_report_name, {"object": obj, "time": time} ) filename = "%s.%s" % (report_name, "xlsx") - response.headers.add( - "Content-Disposition", content_disposition(filename) - ) + if not response.headers.get("Content-Disposition"): + response.headers.add( + "Content-Disposition", content_disposition(filename) + ) return response - else: - return super(ReportController, self).report_download(data, context) - except Exception as e: - _logger.exception("Error while generating report %s", reportname) - se = _serialize_exception(e) - error = {"code": 200, "message": "Odoo Server Error", "data": se} - return request.make_response(html_escape(json.dumps(error))) + except Exception as e: + _logger.exception("Error while generating report %s", reportname) + se = _serialize_exception(e) + error = {"code": 200, "message": "Odoo Server Error", "data": se} + return request.make_response(html_escape(json.dumps(error))) + return super(ReportController, self).report_download(data, context) diff --git a/.void/report_xlsx/demo/report.xml b/report_xlsx/demo/report.xml similarity index 100% rename from .void/report_xlsx/demo/report.xml rename to report_xlsx/demo/report.xml diff --git a/report_xlsx/i18n/ca.po b/report_xlsx/i18n/ca.po new file mode 100644 index 0000000..bf4f77a --- /dev/null +++ b/report_xlsx/i18n/ca.po @@ -0,0 +1,66 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * report_xlsx +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2022-04-22 13:05+0000\n" +"Last-Translator: pablontura \n" +"Language-Team: none\n" +"Language: ca\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" +"X-Generator: Weblate 4.3.2\n" + +#. module: report_xlsx +#: code:addons/report_xlsx/models/ir_report.py:0 +#, python-format +msgid "%s model was not found" +msgstr "No s'ha trobat el model %s" + +#. module: report_xlsx +#: model:ir.model,name:report_xlsx.model_report_report_xlsx_abstract +msgid "Abstract XLSX Report" +msgstr "Informe XLSX abstracte" + +#. module: report_xlsx +#: model:ir.model,name:report_xlsx.model_report_report_xlsx_partner_xlsx +msgid "Partner XLSX Report" +msgstr "Informe XLSX del soci" + +#. module: report_xlsx +#: model:ir.actions.report,name:report_xlsx.partner_xlsx +msgid "Print to XLSX" +msgstr "Imprimeix a XLSX" + +#. module: report_xlsx +#: model:ir.model,name:report_xlsx.model_ir_actions_report +msgid "Report Action" +msgstr "Informe d'acció" + +#. module: report_xlsx +#: model:ir.model.fields,field_description:report_xlsx.field_ir_actions_report__report_type +msgid "Report Type" +msgstr "Tipus d'informe" + +#. module: report_xlsx +#: model:ir.model.fields,help:report_xlsx.field_ir_actions_report__report_type +msgid "" +"The type of the report that will be rendered, each one having its own " +"rendering method. HTML means the report will be opened directly in your " +"browser PDF means the report will be rendered using Wkhtmltopdf and " +"downloaded by the user." +msgstr "" +"El tipus d'informe que es renderà, cadascun amb el seu propi mètode de " +"representació. HTML significa que l'informe s'obrirà directament al vostre " +"navegador, PDF significa que l'informe es representarà amb Wkhtmltopdf i " +"l'usuari el baixarà." + +#. module: report_xlsx +#: model:ir.model.fields.selection,name:report_xlsx.selection__ir_actions_report__report_type__xlsx +msgid "XLSX" +msgstr "XLSX" diff --git a/.void/report_xlsx/i18n/de.po b/report_xlsx/i18n/de.po similarity index 66% rename from .void/report_xlsx/i18n/de.po rename to report_xlsx/i18n/de.po index c69d620..5d0e9fc 100644 --- a/.void/report_xlsx/i18n/de.po +++ b/report_xlsx/i18n/de.po @@ -25,40 +25,11 @@ msgstr "" msgid "%s model was not found" msgstr "%s Modell wurde nicht gefunden" -#. module: report_xlsx -#. openerp-web -#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0 -#, python-format -msgid "" -"A popup window with your report was blocked. You may need to change your " -"browser settings to allow popup windows for this page." -msgstr "" -"Ein Popup-Fenster wurde abgewiesen. Sie werden vermutlich Ihre Browser-" -"Einstellungen ändern müssen, damit die Anzeige dieser Seite möglich wird." - #. module: report_xlsx #: model:ir.model,name:report_xlsx.model_report_report_xlsx_abstract msgid "Abstract XLSX Report" msgstr "Abstrakter XLSX-Bericht" -#. module: report_xlsx -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__display_name -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__display_name -msgid "Display Name" -msgstr "Name anzeigen" - -#. module: report_xlsx -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__id -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__id -msgid "ID" -msgstr "ID" - -#. module: report_xlsx -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract____last_update -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx____last_update -msgid "Last Modified on" -msgstr "Zuletzt geändert am" - #. module: report_xlsx #: model:ir.model,name:report_xlsx.model_report_report_xlsx_partner_xlsx #, fuzzy @@ -93,18 +64,32 @@ msgstr "" "wird, PDF bedeutet, dass der Bericht mittels Wkhtmltopdf gewandelt wird und " "vom Anwender heruntergeladen wird." -#. module: report_xlsx -#. openerp-web -#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0 -#, python-format -msgid "Warning" -msgstr "Hinweis" - #. module: report_xlsx #: model:ir.model.fields.selection,name:report_xlsx.selection__ir_actions_report__report_type__xlsx msgid "XLSX" msgstr "XLSX" +#, python-format +#~ msgid "" +#~ "A popup window with your report was blocked. You may need to change your " +#~ "browser settings to allow popup windows for this page." +#~ msgstr "" +#~ "Ein Popup-Fenster wurde abgewiesen. Sie werden vermutlich Ihre Browser-" +#~ "Einstellungen ändern müssen, damit die Anzeige dieser Seite möglich wird." + +#~ msgid "Display Name" +#~ msgstr "Name anzeigen" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Zuletzt geändert am" + +#, python-format +#~ msgid "Warning" +#~ msgstr "Hinweis" + #~ msgid "HTML" #~ msgstr "HTML" diff --git a/.void/report_xlsx/i18n/es.po b/report_xlsx/i18n/es.po similarity index 58% rename from .void/report_xlsx/i18n/es.po rename to report_xlsx/i18n/es.po index 4d4b7a4..107d0c4 100644 --- a/.void/report_xlsx/i18n/es.po +++ b/report_xlsx/i18n/es.po @@ -9,15 +9,15 @@ msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-11-01 20:11+0000\n" -"PO-Revision-Date: 2021-03-16 12:45+0000\n" -"Last-Translator: Ana Suárez \n" +"PO-Revision-Date: 2023-07-13 20:08+0000\n" +"Last-Translator: Ivorra78 \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" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.3.2\n" +"X-Generator: Weblate 4.17\n" #. module: report_xlsx #: code:addons/report_xlsx/models/ir_report.py:0 @@ -25,41 +25,10 @@ msgstr "" msgid "%s model was not found" msgstr "%s modelo no fue encontrado" -#. module: report_xlsx -#. openerp-web -#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0 -#, python-format -msgid "" -"A popup window with your report was blocked. You may need to change your " -"browser settings to allow popup windows for this page." -msgstr "" -"Una ventana emergente con su informe fue bloqueada. Puede que necesite " -"cambiar las preferencias de su navegador para que permita ventanas " -"emergentes en esta página." - #. module: report_xlsx #: model:ir.model,name:report_xlsx.model_report_report_xlsx_abstract -#, fuzzy msgid "Abstract XLSX Report" -msgstr "Resumen Informe XLSX" - -#. module: report_xlsx -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__display_name -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__display_name -msgid "Display Name" -msgstr "Nombre mostrado" - -#. module: report_xlsx -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__id -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__id -msgid "ID" -msgstr "ID" - -#. module: report_xlsx -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract____last_update -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx____last_update -msgid "Last Modified on" -msgstr "Última modificación el" +msgstr "Informe XLSX en abstracto" #. module: report_xlsx #: model:ir.model,name:report_xlsx.model_report_report_xlsx_partner_xlsx @@ -73,9 +42,8 @@ msgstr "Imprimir en XLSX" #. module: report_xlsx #: model:ir.model,name:report_xlsx.model_ir_actions_report -#, fuzzy msgid "Report Action" -msgstr "Acción informe" +msgstr "Informar Acción" #. module: report_xlsx #: model:ir.model.fields,field_description:report_xlsx.field_ir_actions_report__report_type @@ -95,18 +63,33 @@ msgstr "" "PDF de su navegador significa que el informe se representará usando " "Wkhtmltopdf y el usuario lo descargará." -#. module: report_xlsx -#. openerp-web -#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0 -#, python-format -msgid "Warning" -msgstr "Aviso" - #. module: report_xlsx #: model:ir.model.fields.selection,name:report_xlsx.selection__ir_actions_report__report_type__xlsx msgid "XLSX" msgstr "XLSX" +#, python-format +#~ msgid "" +#~ "A popup window with your report was blocked. You may need to change your " +#~ "browser settings to allow popup windows for this page." +#~ msgstr "" +#~ "Una ventana emergente con su informe fue bloqueada. Puede que necesite " +#~ "cambiar las preferencias de su navegador para que permita ventanas " +#~ "emergentes en esta página." + +#~ msgid "Display Name" +#~ msgstr "Nombre mostrado" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Última modificación el" + +#, python-format +#~ msgid "Warning" +#~ msgstr "Aviso" + #, fuzzy #~ msgid "ir.actions.report" #~ msgstr "ir.actions.report.xml" diff --git a/.void/report_xlsx/i18n/fr.po b/report_xlsx/i18n/fr.po similarity index 64% rename from .void/report_xlsx/i18n/fr.po rename to report_xlsx/i18n/fr.po index d38f9fa..88689cb 100644 --- a/.void/report_xlsx/i18n/fr.po +++ b/report_xlsx/i18n/fr.po @@ -24,38 +24,11 @@ msgstr "" msgid "%s model was not found" msgstr "model '%s' n'a pas été trouvé" -#. module: report_xlsx -#. openerp-web -#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0 -#, python-format -msgid "" -"A popup window with your report was blocked. You may need to change your " -"browser settings to allow popup windows for this page." -msgstr "" - #. module: report_xlsx #: model:ir.model,name:report_xlsx.model_report_report_xlsx_abstract msgid "Abstract XLSX Report" msgstr "" -#. module: report_xlsx -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__display_name -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__display_name -msgid "Display Name" -msgstr "Nom" - -#. module: report_xlsx -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__id -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__id -msgid "ID" -msgstr "ID" - -#. module: report_xlsx -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract____last_update -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx____last_update -msgid "Last Modified on" -msgstr "Dernière modification le" - #. module: report_xlsx #: model:ir.model,name:report_xlsx.model_report_report_xlsx_partner_xlsx msgid "Partner XLSX Report" @@ -85,18 +58,20 @@ msgid "" "downloaded by the user." msgstr "" -#. module: report_xlsx -#. openerp-web -#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0 -#, python-format -msgid "Warning" -msgstr "" - #. module: report_xlsx #: model:ir.model.fields.selection,name:report_xlsx.selection__ir_actions_report__report_type__xlsx msgid "XLSX" msgstr "" +#~ msgid "Display Name" +#~ msgstr "Nom" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Dernière modification le" + #~ msgid "report.report_xlsx.partner_xlsx" #~ msgstr "report.report_xlsx.partner_xlsx" diff --git a/report_xlsx/i18n/gl.po b/report_xlsx/i18n/gl.po new file mode 100644 index 0000000..c47e160 --- /dev/null +++ b/report_xlsx/i18n/gl.po @@ -0,0 +1,66 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * report_xlsx +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2026-05-23 18:47+0000\n" +"Last-Translator: Pablo Castelo \n" +"Language-Team: none\n" +"Language: gl\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" +"X-Generator: Weblate 5.15.2\n" + +#. module: report_xlsx +#: code:addons/report_xlsx/models/ir_report.py:0 +#, python-format +msgid "%s model was not found" +msgstr "%s modelo non foi atopado" + +#. module: report_xlsx +#: model:ir.model,name:report_xlsx.model_report_report_xlsx_abstract +msgid "Abstract XLSX Report" +msgstr "Informe XLSX en abstracto" + +#. module: report_xlsx +#: model:ir.model,name:report_xlsx.model_report_report_xlsx_partner_xlsx +msgid "Partner XLSX Report" +msgstr "Informe empresa XLSX" + +#. module: report_xlsx +#: model:ir.actions.report,name:report_xlsx.partner_xlsx +msgid "Print to XLSX" +msgstr "Imprimir en XLSX" + +#. module: report_xlsx +#: model:ir.model,name:report_xlsx.model_ir_actions_report +msgid "Report Action" +msgstr "Informar Acción" + +#. module: report_xlsx +#: model:ir.model.fields,field_description:report_xlsx.field_ir_actions_report__report_type +msgid "Report Type" +msgstr "Tipo informe" + +#. module: report_xlsx +#: model:ir.model.fields,help:report_xlsx.field_ir_actions_report__report_type +msgid "" +"The type of the report that will be rendered, each one having its own " +"rendering method. HTML means the report will be opened directly in your " +"browser PDF means the report will be rendered using Wkhtmltopdf and " +"downloaded by the user." +msgstr "" +"O tipo de informe que se representará, cada un co seu propio método de " +"representación. HTML significa que o informe se abrirá directamente no PDF " +"do seu navegador significa que o informe se representará usando Wkhtmltopdf " +"e o usuario descargarao." + +#. module: report_xlsx +#: model:ir.model.fields.selection,name:report_xlsx.selection__ir_actions_report__report_type__xlsx +msgid "XLSX" +msgstr "XLSX" diff --git a/.void/report_xlsx/i18n/hr.po b/report_xlsx/i18n/hr.po similarity index 63% rename from .void/report_xlsx/i18n/hr.po rename to report_xlsx/i18n/hr.po index 78456ea..c5db7bc 100644 --- a/.void/report_xlsx/i18n/hr.po +++ b/report_xlsx/i18n/hr.po @@ -25,38 +25,11 @@ msgstr "" msgid "%s model was not found" msgstr "" -#. module: report_xlsx -#. openerp-web -#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0 -#, python-format -msgid "" -"A popup window with your report was blocked. You may need to change your " -"browser settings to allow popup windows for this page." -msgstr "" - #. module: report_xlsx #: model:ir.model,name:report_xlsx.model_report_report_xlsx_abstract msgid "Abstract XLSX Report" msgstr "" -#. module: report_xlsx -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__display_name -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__display_name -msgid "Display Name" -msgstr "" - -#. module: report_xlsx -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__id -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__id -msgid "ID" -msgstr "" - -#. module: report_xlsx -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract____last_update -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx____last_update -msgid "Last Modified on" -msgstr "" - #. module: report_xlsx #: model:ir.model,name:report_xlsx.model_report_report_xlsx_partner_xlsx msgid "Partner XLSX Report" @@ -86,13 +59,6 @@ msgid "" "downloaded by the user." msgstr "" -#. module: report_xlsx -#. openerp-web -#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0 -#, python-format -msgid "Warning" -msgstr "" - #. module: report_xlsx #: model:ir.model.fields.selection,name:report_xlsx.selection__ir_actions_report__report_type__xlsx msgid "XLSX" diff --git a/.void/report_xlsx/i18n/hr_HR.po b/report_xlsx/i18n/hr_HR.po similarity index 63% rename from .void/report_xlsx/i18n/hr_HR.po rename to report_xlsx/i18n/hr_HR.po index 1fa8689..fe1d166 100644 --- a/.void/report_xlsx/i18n/hr_HR.po +++ b/report_xlsx/i18n/hr_HR.po @@ -26,38 +26,11 @@ msgstr "" msgid "%s model was not found" msgstr "" -#. module: report_xlsx -#. openerp-web -#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0 -#, python-format -msgid "" -"A popup window with your report was blocked. You may need to change your " -"browser settings to allow popup windows for this page." -msgstr "" - #. module: report_xlsx #: model:ir.model,name:report_xlsx.model_report_report_xlsx_abstract msgid "Abstract XLSX Report" msgstr "" -#. module: report_xlsx -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__display_name -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__display_name -msgid "Display Name" -msgstr "" - -#. module: report_xlsx -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__id -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__id -msgid "ID" -msgstr "" - -#. module: report_xlsx -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract____last_update -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx____last_update -msgid "Last Modified on" -msgstr "" - #. module: report_xlsx #: model:ir.model,name:report_xlsx.model_report_report_xlsx_partner_xlsx msgid "Partner XLSX Report" @@ -87,13 +60,6 @@ msgid "" "downloaded by the user." msgstr "" -#. module: report_xlsx -#. openerp-web -#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0 -#, python-format -msgid "Warning" -msgstr "" - #. module: report_xlsx #: model:ir.model.fields.selection,name:report_xlsx.selection__ir_actions_report__report_type__xlsx msgid "XLSX" diff --git a/.void/report_xlsx/i18n/it.po b/report_xlsx/i18n/it.po similarity index 62% rename from .void/report_xlsx/i18n/it.po rename to report_xlsx/i18n/it.po index 0d23411..63808c5 100644 --- a/.void/report_xlsx/i18n/it.po +++ b/report_xlsx/i18n/it.po @@ -24,38 +24,11 @@ msgstr "" msgid "%s model was not found" msgstr "" -#. module: report_xlsx -#. openerp-web -#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0 -#, python-format -msgid "" -"A popup window with your report was blocked. You may need to change your " -"browser settings to allow popup windows for this page." -msgstr "" - #. module: report_xlsx #: model:ir.model,name:report_xlsx.model_report_report_xlsx_abstract msgid "Abstract XLSX Report" msgstr "" -#. module: report_xlsx -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__display_name -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__display_name -msgid "Display Name" -msgstr "" - -#. module: report_xlsx -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__id -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__id -msgid "ID" -msgstr "" - -#. module: report_xlsx -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract____last_update -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx____last_update -msgid "Last Modified on" -msgstr "" - #. module: report_xlsx #: model:ir.model,name:report_xlsx.model_report_report_xlsx_partner_xlsx msgid "Partner XLSX Report" @@ -85,13 +58,6 @@ msgid "" "downloaded by the user." msgstr "" -#. module: report_xlsx -#. openerp-web -#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0 -#, python-format -msgid "Warning" -msgstr "" - #. module: report_xlsx #: model:ir.model.fields.selection,name:report_xlsx.selection__ir_actions_report__report_type__xlsx msgid "XLSX" diff --git a/.void/report_xlsx/i18n/nl_NL.po b/report_xlsx/i18n/nl_NL.po similarity index 62% rename from .void/report_xlsx/i18n/nl_NL.po rename to report_xlsx/i18n/nl_NL.po index 425242a..50efd97 100644 --- a/.void/report_xlsx/i18n/nl_NL.po +++ b/report_xlsx/i18n/nl_NL.po @@ -25,38 +25,11 @@ msgstr "" msgid "%s model was not found" msgstr "" -#. module: report_xlsx -#. openerp-web -#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0 -#, python-format -msgid "" -"A popup window with your report was blocked. You may need to change your " -"browser settings to allow popup windows for this page." -msgstr "" - #. module: report_xlsx #: model:ir.model,name:report_xlsx.model_report_report_xlsx_abstract msgid "Abstract XLSX Report" msgstr "" -#. module: report_xlsx -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__display_name -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__display_name -msgid "Display Name" -msgstr "" - -#. module: report_xlsx -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__id -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__id -msgid "ID" -msgstr "" - -#. module: report_xlsx -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract____last_update -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx____last_update -msgid "Last Modified on" -msgstr "" - #. module: report_xlsx #: model:ir.model,name:report_xlsx.model_report_report_xlsx_partner_xlsx msgid "Partner XLSX Report" @@ -86,13 +59,6 @@ msgid "" "downloaded by the user." msgstr "" -#. module: report_xlsx -#. openerp-web -#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0 -#, python-format -msgid "Warning" -msgstr "" - #. module: report_xlsx #: model:ir.model.fields.selection,name:report_xlsx.selection__ir_actions_report__report_type__xlsx msgid "XLSX" diff --git a/.void/report_xlsx/i18n/pt.po b/report_xlsx/i18n/pt.po similarity index 63% rename from .void/report_xlsx/i18n/pt.po rename to report_xlsx/i18n/pt.po index 3b1796c..f64a941 100644 --- a/.void/report_xlsx/i18n/pt.po +++ b/report_xlsx/i18n/pt.po @@ -22,40 +22,11 @@ msgstr "" msgid "%s model was not found" msgstr "O modelo %s não foi encontrado" -#. module: report_xlsx -#. openerp-web -#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0 -#, python-format -msgid "" -"A popup window with your report was blocked. You may need to change your " -"browser settings to allow popup windows for this page." -msgstr "" -"Uma janela popup com o seu relatório foi bloqueada. Pode necessitar de mudar " -"as configurações do browser para permitir janelas popup nesta página." - #. module: report_xlsx #: model:ir.model,name:report_xlsx.model_report_report_xlsx_abstract msgid "Abstract XLSX Report" msgstr "Relatório XLSX Abstrato" -#. module: report_xlsx -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__display_name -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__display_name -msgid "Display Name" -msgstr "Nome a Exibir" - -#. module: report_xlsx -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__id -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__id -msgid "ID" -msgstr "ID" - -#. module: report_xlsx -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract____last_update -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx____last_update -msgid "Last Modified on" -msgstr "Última Modificação em" - #. module: report_xlsx #: model:ir.model,name:report_xlsx.model_report_report_xlsx_partner_xlsx msgid "Partner XLSX Report" @@ -89,18 +60,33 @@ msgstr "" "browser. PDF indica que o relatório será produzido com o Wkhtmltopdf e " "descarregado pelo utilizador." -#. module: report_xlsx -#. openerp-web -#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0 -#, python-format -msgid "Warning" -msgstr "Aviso" - #. module: report_xlsx #: model:ir.model.fields.selection,name:report_xlsx.selection__ir_actions_report__report_type__xlsx msgid "XLSX" msgstr "XLSX" +#, python-format +#~ msgid "" +#~ "A popup window with your report was blocked. You may need to change your " +#~ "browser settings to allow popup windows for this page." +#~ msgstr "" +#~ "Uma janela popup com o seu relatório foi bloqueada. Pode necessitar de " +#~ "mudar as configurações do browser para permitir janelas popup nesta " +#~ "página." + +#~ msgid "Display Name" +#~ msgstr "Nome a Exibir" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Última Modificação em" + +#, python-format +#~ msgid "Warning" +#~ msgstr "Aviso" + #~ msgid "HTML" #~ msgstr "HTML" diff --git a/.void/report_xlsx/i18n/pt_PT.po b/report_xlsx/i18n/pt_PT.po similarity index 62% rename from .void/report_xlsx/i18n/pt_PT.po rename to report_xlsx/i18n/pt_PT.po index 322986c..9a4adfc 100644 --- a/.void/report_xlsx/i18n/pt_PT.po +++ b/report_xlsx/i18n/pt_PT.po @@ -25,38 +25,11 @@ msgstr "" msgid "%s model was not found" msgstr "" -#. module: report_xlsx -#. openerp-web -#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0 -#, python-format -msgid "" -"A popup window with your report was blocked. You may need to change your " -"browser settings to allow popup windows for this page." -msgstr "" - #. module: report_xlsx #: model:ir.model,name:report_xlsx.model_report_report_xlsx_abstract msgid "Abstract XLSX Report" msgstr "" -#. module: report_xlsx -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__display_name -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__display_name -msgid "Display Name" -msgstr "" - -#. module: report_xlsx -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__id -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__id -msgid "ID" -msgstr "" - -#. module: report_xlsx -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract____last_update -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx____last_update -msgid "Last Modified on" -msgstr "" - #. module: report_xlsx #: model:ir.model,name:report_xlsx.model_report_report_xlsx_partner_xlsx msgid "Partner XLSX Report" @@ -86,13 +59,6 @@ msgid "" "downloaded by the user." msgstr "" -#. module: report_xlsx -#. openerp-web -#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0 -#, python-format -msgid "Warning" -msgstr "" - #. module: report_xlsx #: model:ir.model.fields.selection,name:report_xlsx.selection__ir_actions_report__report_type__xlsx msgid "XLSX" diff --git a/report_xlsx/i18n/report_xlsx.pot b/report_xlsx/i18n/report_xlsx.pot new file mode 100644 index 0000000..dcdea3d --- /dev/null +++ b/report_xlsx/i18n/report_xlsx.pot @@ -0,0 +1,59 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * report_xlsx +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.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: report_xlsx +#: code:addons/report_xlsx/models/ir_report.py:0 +#, python-format +msgid "%s model was not found" +msgstr "" + +#. module: report_xlsx +#: model:ir.model,name:report_xlsx.model_report_report_xlsx_abstract +msgid "Abstract XLSX Report" +msgstr "" + +#. module: report_xlsx +#: model:ir.model,name:report_xlsx.model_report_report_xlsx_partner_xlsx +msgid "Partner XLSX Report" +msgstr "" + +#. module: report_xlsx +#: model:ir.actions.report,name:report_xlsx.partner_xlsx +msgid "Print to XLSX" +msgstr "" + +#. module: report_xlsx +#: model:ir.model,name:report_xlsx.model_ir_actions_report +msgid "Report Action" +msgstr "" + +#. module: report_xlsx +#: model:ir.model.fields,field_description:report_xlsx.field_ir_actions_report__report_type +msgid "Report Type" +msgstr "" + +#. module: report_xlsx +#: model:ir.model.fields,help:report_xlsx.field_ir_actions_report__report_type +msgid "" +"The type of the report that will be rendered, each one having its own " +"rendering method. HTML means the report will be opened directly in your " +"browser PDF means the report will be rendered using Wkhtmltopdf and " +"downloaded by the user." +msgstr "" + +#. module: report_xlsx +#: model:ir.model.fields.selection,name:report_xlsx.selection__ir_actions_report__report_type__xlsx +msgid "XLSX" +msgstr "" diff --git a/.void/report_xlsx/i18n/sv.po b/report_xlsx/i18n/sv.po similarity index 56% rename from .void/report_xlsx/i18n/sv.po rename to report_xlsx/i18n/sv.po index 563001e..5defdbf 100644 --- a/.void/report_xlsx/i18n/sv.po +++ b/report_xlsx/i18n/sv.po @@ -22,44 +22,11 @@ msgstr "" msgid "%s model was not found" msgstr "%s modell hittades inte" -#. module: report_xlsx -#. openerp-web -#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0 -#, python-format -msgid "" -"A popup window with your report was blocked. You may need to change your " -"browser settings to allow popup windows for this page." -msgstr "" -"Ett popup-fönster med din rapport blockerades. Du kan behöva ändra " -"inställningarna i din webbläsare för att tillåta popup-fönster på den här " -"sidan." - #. module: report_xlsx #: model:ir.model,name:report_xlsx.model_report_report_xlsx_abstract msgid "Abstract XLSX Report" msgstr "" -#. module: report_xlsx -#: model:ir.model.fields,field_description:report_xlsx.field_ir_actions_report__display_name -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__display_name -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__display_name -msgid "Display Name" -msgstr "Visningsnamn" - -#. module: report_xlsx -#: model:ir.model.fields,field_description:report_xlsx.field_ir_actions_report__id -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__id -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__id -msgid "ID" -msgstr "ID" - -#. module: report_xlsx -#: model:ir.model.fields,field_description:report_xlsx.field_ir_actions_report____last_update -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract____last_update -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx____last_update -msgid "Last Modified on" -msgstr "Senast ändrad den" - #. module: report_xlsx #: model:ir.model,name:report_xlsx.model_report_report_xlsx_partner_xlsx msgid "Partner XLSX Report" @@ -92,14 +59,29 @@ msgstr "" "renderingsmetod. HTML innebär att rapporten öppnas direkt i webbläsaren, PDF " "betyder att rapporten renderas med Wkhtmltopdf och laddas ner av användaren." -#. module: report_xlsx -#. openerp-web -#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0 -#, python-format -msgid "Warning" -msgstr "Varning" - #. module: report_xlsx #: model:ir.model.fields.selection,name:report_xlsx.selection__ir_actions_report__report_type__xlsx msgid "XLSX" msgstr "XLSX" + +#, python-format +#~ msgid "" +#~ "A popup window with your report was blocked. You may need to change your " +#~ "browser settings to allow popup windows for this page." +#~ msgstr "" +#~ "Ett popup-fönster med din rapport blockerades. Du kan behöva ändra " +#~ "inställningarna i din webbläsare för att tillåta popup-fönster på den här " +#~ "sidan." + +#~ msgid "Display Name" +#~ msgstr "Visningsnamn" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Senast ändrad den" + +#, python-format +#~ msgid "Warning" +#~ msgstr "Varning" diff --git a/.void/report_xlsx/i18n/tr.po b/report_xlsx/i18n/tr.po similarity index 62% rename from .void/report_xlsx/i18n/tr.po rename to report_xlsx/i18n/tr.po index 01e756a..84d341c 100644 --- a/.void/report_xlsx/i18n/tr.po +++ b/report_xlsx/i18n/tr.po @@ -24,38 +24,11 @@ msgstr "" msgid "%s model was not found" msgstr "" -#. module: report_xlsx -#. openerp-web -#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0 -#, python-format -msgid "" -"A popup window with your report was blocked. You may need to change your " -"browser settings to allow popup windows for this page." -msgstr "" - #. module: report_xlsx #: model:ir.model,name:report_xlsx.model_report_report_xlsx_abstract msgid "Abstract XLSX Report" msgstr "" -#. module: report_xlsx -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__display_name -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__display_name -msgid "Display Name" -msgstr "" - -#. module: report_xlsx -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract__id -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx__id -msgid "ID" -msgstr "" - -#. module: report_xlsx -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_abstract____last_update -#: model:ir.model.fields,field_description:report_xlsx.field_report_report_xlsx_partner_xlsx____last_update -msgid "Last Modified on" -msgstr "" - #. module: report_xlsx #: model:ir.model,name:report_xlsx.model_report_report_xlsx_partner_xlsx msgid "Partner XLSX Report" @@ -85,13 +58,6 @@ msgid "" "downloaded by the user." msgstr "" -#. module: report_xlsx -#. openerp-web -#: code:addons/report_xlsx/static/src/js/report/action_manager_report.js:0 -#, python-format -msgid "Warning" -msgstr "" - #. module: report_xlsx #: model:ir.model.fields.selection,name:report_xlsx.selection__ir_actions_report__report_type__xlsx msgid "XLSX" diff --git a/.void/report_xlsx/models/__init__.py b/report_xlsx/models/__init__.py similarity index 100% rename from .void/report_xlsx/models/__init__.py rename to report_xlsx/models/__init__.py diff --git a/.void/report_xlsx/models/ir_report.py b/report_xlsx/models/ir_report.py similarity index 100% rename from .void/report_xlsx/models/ir_report.py rename to report_xlsx/models/ir_report.py diff --git a/.void/report_xlsx/readme/CONTRIBUTORS.rst b/report_xlsx/readme/CONTRIBUTORS.rst similarity index 100% rename from .void/report_xlsx/readme/CONTRIBUTORS.rst rename to report_xlsx/readme/CONTRIBUTORS.rst diff --git a/.void/report_xlsx/readme/DESCRIPTION.rst b/report_xlsx/readme/DESCRIPTION.rst similarity index 100% rename from .void/report_xlsx/readme/DESCRIPTION.rst rename to report_xlsx/readme/DESCRIPTION.rst diff --git a/.void/report_xlsx/readme/INSTALL.rst b/report_xlsx/readme/INSTALL.rst similarity index 100% rename from .void/report_xlsx/readme/INSTALL.rst rename to report_xlsx/readme/INSTALL.rst diff --git a/.void/report_xlsx/readme/USAGE.rst b/report_xlsx/readme/USAGE.rst similarity index 60% rename from .void/report_xlsx/readme/USAGE.rst rename to report_xlsx/readme/USAGE.rst index 7510385..254ccc1 100644 --- a/.void/report_xlsx/readme/USAGE.rst +++ b/report_xlsx/readme/USAGE.rst @@ -21,12 +21,13 @@ To manipulate the ``workbook`` and ``sheet`` objects, refer to the A report XML record :: - + + Print to XLSX + res.partner + xlsx + module_name.report_name + module_name.report_file + + report + + diff --git a/.void/report_xlsx/report/__init__.py b/report_xlsx/report/__init__.py similarity index 100% rename from .void/report_xlsx/report/__init__.py rename to report_xlsx/report/__init__.py diff --git a/.void/report_xlsx/report/report_abstract_xlsx.py b/report_xlsx/report/report_abstract_xlsx.py similarity index 92% rename from .void/report_xlsx/report/report_abstract_xlsx.py rename to report_xlsx/report/report_abstract_xlsx.py index af7ce65..3e70aac 100644 --- a/.void/report_xlsx/report/report_abstract_xlsx.py +++ b/report_xlsx/report/report_abstract_xlsx.py @@ -91,6 +91,13 @@ def _get_objs_for_report(self, docids, data): ids = self.env.context.get("active_ids", []) return self.env[self.env.context.get("active_model")].browse(ids) + def _report_xlsx_currency_format(self, currency): + """Get the format to be used in cells (symbol included). + Used in account_financial_report addon""" + s_before = currency.symbol if currency.position == "before" else "" + s_after = " %s" % currency.symbol if currency.position == "after" else "" + return f"{f'{s_before}'}#,##0.{'0' * currency.decimal_places}{f'{s_after}'}" + def create_xlsx_report(self, docids, data): objs = self._get_objs_for_report(docids, data) file_data = BytesIO() diff --git a/.void/report_xlsx/report/report_partner_xlsx.py b/report_xlsx/report/report_partner_xlsx.py similarity index 100% rename from .void/report_xlsx/report/report_partner_xlsx.py rename to report_xlsx/report/report_partner_xlsx.py diff --git a/.void/report_xlsx/static/description/icon.png b/report_xlsx/static/description/icon.png similarity index 100% rename from .void/report_xlsx/static/description/icon.png rename to report_xlsx/static/description/icon.png diff --git a/.void/report_xlsx/static/description/index.html b/report_xlsx/static/description/index.html similarity index 77% rename from .void/report_xlsx/static/description/index.html rename to report_xlsx/static/description/index.html index 5bf38ac..c919ce2 100644 --- a/.void/report_xlsx/static/description/index.html +++ b/report_xlsx/static/description/index.html @@ -1,20 +1,20 @@ - - + Base report xlsx + + +
+ + + +Odoo Community Association + +
+

Survey XLSX

+ +

Beta License: AGPL-3 OCA/survey Translate me on Weblate Try me on Runboat

+

This module allows to print a XLSX report with the survey results.

+

Table of contents

+ +
+

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 to smash it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Creu Blanca
  • +
+
+ +
+

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/survey project on GitHub.

+

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

+
+
+
+
+ + diff --git a/survey_xlsx/tests/__init__.py b/survey_xlsx/tests/__init__.py new file mode 100644 index 0000000..32ae3c2 --- /dev/null +++ b/survey_xlsx/tests/__init__.py @@ -0,0 +1 @@ +from . import test_report diff --git a/survey_xlsx/tests/test_report.py b/survey_xlsx/tests/test_report.py new file mode 100644 index 0000000..4e17bba --- /dev/null +++ b/survey_xlsx/tests/test_report.py @@ -0,0 +1,84 @@ +# Copyright 2022 Creu Blanca +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +import logging +from datetime import date + +import freezegun + +from odoo.addons.survey.tests import common + +_logger = logging.getLogger(__name__) + +try: + from xlrd import open_workbook +except ImportError: + _logger.debug("Can not import xlrd`.") + + +@freezegun.freeze_time("2022-04-26") +class TestReport(common.TestSurveyCommon): + def setUp(self): + super(TestReport, self).setUp() + self.question_date = ( + self.env["survey.question"] + .with_user(self.survey_manager) + .create( + { + "title": "Test Date", + "survey_id": self.survey.id, + "sequence": 4, + "question_type": "date", + } + ) + ) + self.suggested_question = self._add_question( + page=self.question_date.page_id, + name="Test Suggested", + qtype="simple_choice", + labels=[ + {"value": "FIRST", "suggested_answer_id": True}, + {"value": "SECOND"}, + ], + survey_id=self.survey.id, + sequence=5, + ) + + answer = self._add_answer(self.survey, False, email="public@example.com") + self._add_answer_line(self.question_ft, answer, "FIRST ANSWER") + self._add_answer_line(self.question_num, answer, 1) + self._add_answer_line(self.question_date, answer, date.today()) + self._add_answer_line( + self.suggested_question, + answer, + self.suggested_question.suggested_answer_ids[0]["id"], + ) + answer._mark_done() + answer2 = self._add_answer(self.survey, False, email="public2@example.com") + self._add_answer_line(self.question_ft, answer2, "SECOND ANSWER") + self._add_answer_line(self.question_num, answer2, 2) + self._add_answer_line( + self.question_date, answer2, False, skipped=True, answer_type=False + ) + self._add_answer_line( + self.suggested_question, + answer2, + self.suggested_question.suggested_answer_ids[1]["id"], + ) + answer2._mark_done() + + def test_report(self): + report = self.env.ref("survey_xlsx.report_survey_xlsx") + self.assertEqual(report.report_type, "xlsx") + rep = report._render(self.survey.ids, {}) + wb = open_workbook(file_contents=rep[0]) + sheet = wb.sheet_by_index(0) + + self.assertEqual(sheet.cell(1, 2).value, "FIRST ANSWER") + self.assertEqual(sheet.cell(2, 2).value, "SECOND ANSWER") + self.assertEqual(sheet.cell(1, 3).value, 1) + self.assertEqual(sheet.cell(2, 3).value, 2) + self.assertEqual(sheet.cell(1, 4).value, "2022-04-26") + self.assertFalse(sheet.cell(2, 4).value) + self.assertEqual(sheet.cell(1, 5).value, "FIRST") + self.assertEqual(sheet.cell(2, 5).value, "SECOND")