diff --git a/README.md b/README.md index 56284ff3e8..6b0f25b989 100644 --- a/README.md +++ b/README.md @@ -25,9 +25,10 @@ addon | version | maintainers | summary [bi_sql_editor](bi_sql_editor/) | 18.0.1.0.4 | legalsylvain | BI Views builder, based on Materialized or Normal SQL Views [pdf_xml_attachment](pdf_xml_attachment/) | 18.0.1.0.0 | simahawk alexis-via | Provides helpers to work w/ PDFs and XML attachments [report_context](report_context/) | 18.0.1.0.0 | | Adding context to reports -[report_csv](report_csv/) | 18.0.1.0.0 | | Base module to create csv report +[report_csv](report_csv/) | 18.0.1.0.2 | | Base module to create csv report [report_display_name_in_footer](report_display_name_in_footer/) | 18.0.1.0.0 | Shide rafaelbn | Show document name in report footer [report_footer_html](report_footer_html/) | 18.0.1.0.0 | Shide rafaelbn | Show HTML content in desired Footer Reports +[report_layout_config](report_layout_config/) | 18.0.1.0.0 | | Add possibility to easily modify the global report layout [report_partner_address](report_partner_address/) | 18.0.1.0.0 | yostashiro aungkokolin1997 | Translatable partner address details for reports and portal [report_pdf_form](report_pdf_form/) | 18.0.1.0.0 | grindtildeath | Fill custom PDF form reports [report_pdf_zip_download](report_pdf_zip_download/) | 18.0.1.0.0 | | Report PDF ZIP Download @@ -41,6 +42,7 @@ addon | version | maintainers | summary [report_qweb_pdf_cover](report_qweb_pdf_cover/) | 18.0.1.0.0 | | Add front and back covers to your QWeb PDF reports [report_qweb_pdf_watermark](report_qweb_pdf_watermark/) | 18.0.1.0.1 | hbrunn | Add watermarks to your QWEB PDF reports [report_substitute](report_substitute/) | 18.0.1.0.0 | sbejaoui | This module allows to create substitution rules for report actions. +[report_text_format_option](report_text_format_option/) | 18.0.1.0.0 | yostashiro aungkokolin1997 | Report Text Format Option [report_wkhtmltopdf_param](report_wkhtmltopdf_param/) | 18.0.1.0.1 | | Add new parameters for a paper format to be used by wkhtmltopdf command as arguments. [report_xlsx](report_xlsx/) | 18.0.1.1.2 | | Base module to create xlsx report [report_xlsx_helper](report_xlsx_helper/) | 18.0.1.0.0 | | Report xlsx helpers diff --git a/report_csv/README.rst b/report_csv/README.rst index 149cad3f9c..ab72aec439 100644 --- a/report_csv/README.rst +++ b/report_csv/README.rst @@ -1,3 +1,7 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + =============== Base report csv =============== @@ -7,13 +11,13 @@ Base report csv !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:380b9dc8c98a77b37a8e5e5846b3ddc471dcbf470c9805cc5f9a04f2e4913f12 + !! source digest: sha256:bc658cd69105f9a3c0e300b2c63a034ed67aa439a5b6b6b05c3155e092a4ac5c !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png :target: https://odoo-community.org/page/development-status :alt: Production/Stable -.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png +.. |badge2| image:: https://img.shields.io/badge/license-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%2Freporting--engine-lightgray.png?logo=github @@ -128,6 +132,10 @@ Contributors - Aung Ko Ko Lin +- `NuoBiT `__: + + - Deniz Gallo dgallo@nuobit.com + Maintainers ----------- diff --git a/report_csv/__manifest__.py b/report_csv/__manifest__.py index 77bf4dcba7..4fd5fb9be8 100644 --- a/report_csv/__manifest__.py +++ b/report_csv/__manifest__.py @@ -6,7 +6,7 @@ "author": "Creu Blanca, Odoo Community Association (OCA)", "website": "https://github.com/OCA/reporting-engine", "category": "Reporting", - "version": "18.0.1.0.0", + "version": "18.0.1.0.2", "license": "AGPL-3", "depends": ["base", "web"], "demo": ["demo/report.xml"], diff --git a/report_csv/models/ir_report.py b/report_csv/models/ir_report.py index 629108272c..ed26fed9ee 100644 --- a/report_csv/models/ir_report.py +++ b/report_csv/models/ir_report.py @@ -55,13 +55,13 @@ def _render_csv(self, report_ref, docids, data): report_sudo = self._get_report(report_ref) report_model_name = f"report.{report_sudo.report_name}" report_model = self.env[report_model_name] - res_id = len(docids) == 1 and docids[0] + res_id = docids and len(docids) == 1 and docids[0] if not res_id or not report_sudo.attachment or not report_sudo.attachment_use: return report_model.with_context( **{ "active_model": report_sudo.model, - "encoding": self.encoding, - "encode_error_handling": self.encode_error_handling, + "encoding": report_sudo.encoding, + "encode_error_handling": report_sudo.encode_error_handling, } ).create_csv_report(docids, data) record = self.env[report_sudo.model].browse(res_id) @@ -71,8 +71,8 @@ def _render_csv(self, report_ref, docids, data): data, ext = report_model.with_context( **{ "active_model": report_sudo.model, - "encoding": self.encoding, - "encode_error_handling": self.encode_error_handling, + "encoding": report_sudo.encoding, + "encode_error_handling": report_sudo.encode_error_handling, } ).create_csv_report(docids, data) report_sudo._create_csv_attachment(record, data) diff --git a/report_csv/readme/CONTRIBUTORS.md b/report_csv/readme/CONTRIBUTORS.md index b80f61ba30..f624d77643 100644 --- a/report_csv/readme/CONTRIBUTORS.md +++ b/report_csv/readme/CONTRIBUTORS.md @@ -3,3 +3,5 @@ - Rattapong Chokmasermkul \<\> - [Quartile](https://www.quartile.co): - Aung Ko Ko Lin +- [NuoBiT](https://www.nuobit.com): + - Deniz Gallo diff --git a/report_csv/static/description/index.html b/report_csv/static/description/index.html index 46b8f8d7e3..4ee713fc85 100644 --- a/report_csv/static/description/index.html +++ b/report_csv/static/description/index.html @@ -3,7 +3,7 @@ -Base report csv +README.rst -
-

Base report csv

+
+ + +Odoo Community Association + +
+

Base report csv

-

Production/Stable License: AGPL-3 OCA/reporting-engine Translate me on Weblate Try me on Runboat

+

Production/Stable License: AGPL-3 OCA/reporting-engine Translate me on Weblate Try me on Runboat

This module provides a basic report class to generate csv report.

Table of contents

@@ -386,7 +391,7 @@

Base report csv

-

Configuration

+

Configuration

In case the exported CSV report should be encoded in another system than UTF-8, following fields of the report record (Settings > Technical > Reports) should be populated accordingly.

@@ -404,7 +409,7 @@

Configuration

-

Usage

+

Usage

An example of CSV report for partners on a module called `module_name`:

A python class :

@@ -446,7 +451,7 @@

Usage

Update encoding with an appropriate value (e.g. cp932) as necessary.

-

Bug Tracker

+

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 @@ -454,15 +459,15 @@

Bug Tracker

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

-

Credits

+

Credits

-

Authors

+

Authors

  • Creu Blanca
-

Contributors

+

Contributors

+
  • NuoBiT: +
  • -

    Maintainers

    +

    Maintainers

    This module is maintained by the OCA.

    Odoo Community Association @@ -487,5 +496,6 @@

    Maintainers

    +
    diff --git a/report_layout_config/README.rst b/report_layout_config/README.rst new file mode 100644 index 0000000000..a4998a313d --- /dev/null +++ b/report_layout_config/README.rst @@ -0,0 +1,92 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +=========================== +Report layout configuration +=========================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:f1064f4ab436ff220954da0d47e14964791f2f0a8f1ffed8ea9761d75d2f01f6 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/license-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%2Freporting--engine-lightgray.png?logo=github + :target: https://github.com/OCA/reporting-engine/tree/18.0/report_layout_config + :alt: OCA/reporting-engine +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/reporting-engine-18-0/reporting-engine-18-0-report_layout_config + :alt: Translate me on Weblate +.. |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=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module provides new report template with possibility to add image +to replace header and footer. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +- In Setting/General Setting/Document Layout: + + - Click on Configure Document Layout + - On the wizard choose Layout images + - Set the Full header image + Full footer image + +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 +------- + +* Camptocamp + +Contributors +------------ + +- Thomas Nowicki +- Iryna Vyshnevska +- Do Anh Duy + +Maintainers +----------- + +This module is maintained by the OCA. + +.. 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/reporting-engine `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/report_layout_config/__init__.py b/report_layout_config/__init__.py new file mode 100644 index 0000000000..9a14fd06d7 --- /dev/null +++ b/report_layout_config/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2020 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import models diff --git a/report_layout_config/__manifest__.py b/report_layout_config/__manifest__.py new file mode 100644 index 0000000000..e4895c18c8 --- /dev/null +++ b/report_layout_config/__manifest__.py @@ -0,0 +1,25 @@ +# Copyright 2020 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + "name": "Report layout configuration", + "summary": "Add possibility to easily modify the global report layout", + "version": "18.0.1.0.0", + "category": "Reporting", + "website": "https://github.com/OCA/reporting-engine", + "author": "Camptocamp, " "Odoo Community Association (OCA)", + "license": "AGPL-3", + "depends": ["web", "base"], + "data": [ + "views/document_layout.xml", + "templates/report_templates.xml", + "data/report_layout.xml", + ], + "assets": { + "web.report_assets_common": [ + "/report_layout_config/static/src/scss/style.scss", + ], + }, + "application": False, + "installable": True, +} diff --git a/report_layout_config/data/report_layout.xml b/report_layout_config/data/report_layout.xml new file mode 100644 index 0000000000..084d0bdfd0 --- /dev/null +++ b/report_layout_config/data/report_layout.xml @@ -0,0 +1,26 @@ + + + + Layout images standard + + /report_layout_config/static/img/preview_standard.png + /report_layout_config/static/pdf/preview_standard.pdf + + + + Layout images clean + + /report_layout_config/static/img/preview_standard.png + /report_layout_config/static/pdf/preview_standard.pdf + + diff --git a/report_layout_config/i18n/es.po b/report_layout_config/i18n/es.po new file mode 100644 index 0000000000..f7bf7b660c --- /dev/null +++ b/report_layout_config/i18n/es.po @@ -0,0 +1,258 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * report_layout_config +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-03-27 20:35+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: none\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.17\n" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +"!important;\n" +" }\n" +" }\n" +" tbody {\n" +" tr:last-child td {\n" +" border-bottom: 3px solid" +msgstr "" +"Importante;\n" +" }\n" +" }\n" +" tbody {\n" +" tr:last-child td {\n" +" border-bottom: 3px sólido" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +"&.o_clean_footer {\n" +" border-top: 3px solid" +msgstr "" +"&.o_clean_footer {\n" +" borde superior: 3px sólido" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +"&.o_report_layout_standard {\n" +" h2 {\n" +" color:" +msgstr "" +"&.o_report_layout_standard {\n" +" h2 {\n" +" color:" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +";\n" +" background-color:" +msgstr "" +";\n" +" color de fondo:" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +";\n" +" tr th {\n" +" border-top: 3px solid" +msgstr "" +";\n" +" tr th {\n" +" borde superior: 3px sólido" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +";\n" +" }\n" +" }\n" +" }\n" +" #total {\n" +" strong {\n" +" color:" +msgstr "" +";\n" +" }\n" +" }\n" +" }\n" +" #total {\n" +" strong {\n" +" color:" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +";\n" +" h4 {\n" +" color:" +msgstr "" +";\n" +" h4 {\n" +" color:" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +";\n" +" }\n" +" .pagenumber {\n" +" border: 3px solid" +msgstr "" +";\n" +" }\n" +" .pagenumber {\n" +" border: 3px solid" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +";\n" +" }\n" +" }\n" +" &.o_report_layout_clean {\n" +" h1, h2, h3 {\n" +" color:" +msgstr "" +";\n" +" }\n" +" }\n" +" &.o_report_layout_clean {\n" +" h1, h2, h3 {\n" +" color:" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +";\n" +" }\n" +" #informations strong {\n" +" color:" +msgstr "" +";\n" +" }\n" +" #informations strong {\n" +" color:" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +";\n" +" }\n" +" #total strong{\n" +" color:" +msgstr "" +";\n" +" }\n" +" #total strong{\n" +" color:" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +";\n" +" }\n" +" strong {\n" +" color:" +msgstr "" +";\n" +" }\n" +" strong {\n" +" color:" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +";\n" +" }\n" +" table {\n" +" thead {\n" +" color:" +msgstr "" +";\n" +" }\n" +" table {\n" +" thead {\n" +" color:" + +#. module: report_layout_config +#: model:ir.model,name:report_layout_config.model_res_company +msgid "Companies" +msgstr "Compañías" + +#. module: report_layout_config +#: model:ir.model,name:report_layout_config.model_base_document_layout +msgid "Company Document Layout" +msgstr "Presentación de Documentos de Empresa" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.external_clean_layout_images_template +#: model_terms:ir.ui.view,arch_db:report_layout_config.external_standard_layout_images_template +msgid "Footer logo" +msgstr "Logotipo a pie de página" + +#. module: report_layout_config +#: model:ir.model.fields,field_description:report_layout_config.field_base_document_layout__full_footer_img +#: model:ir.model.fields,field_description:report_layout_config.field_res_company__full_footer_img +msgid "Full footer image" +msgstr "Imagen completa del pie de página" + +#. module: report_layout_config +#: model:ir.model.fields,field_description:report_layout_config.field_base_document_layout__full_header_img +#: model:ir.model.fields,field_description:report_layout_config.field_res_company__full_header_img +msgid "Full header image" +msgstr "Imagen de cabecera completa" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.external_clean_layout_images_template +#: model_terms:ir.ui.view,arch_db:report_layout_config.external_standard_layout_images_template +msgid "Logo" +msgstr "Logotipo" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.external_clean_layout_images_template +#: model_terms:ir.ui.view,arch_db:report_layout_config.external_standard_layout_images_template +msgid "Page: / " +msgstr "Página: / " + +#. module: report_layout_config +#: model:ir.model.fields,help:report_layout_config.field_base_document_layout__full_footer_img +msgid "Replaces whole footer, disables footer logo" +msgstr "" +"Sustituye todo el pie de página, desactiva el logotipo del pie de página" + +#. module: report_layout_config +#: model:ir.model.fields,help:report_layout_config.field_base_document_layout__full_header_img +msgid "Replaces whole header with image" +msgstr "Sustituye toda la cabecera por una imagen" + +#. module: report_layout_config +#: model:ir.model.fields,help:report_layout_config.field_res_company__full_footer_img +msgid "This image will replace all footer." +msgstr "Sustituye toda la cabecera por una imagen" + +#. module: report_layout_config +#: model:ir.model.fields,help:report_layout_config.field_res_company__full_header_img +msgid "This image will replace all header." +msgstr "Esta imagen sustituirá a todos los encabezados." + +#~ msgid "Display Name" +#~ msgstr "Mostrar Nombre" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Última Modificación el" diff --git a/report_layout_config/i18n/it.po b/report_layout_config/i18n/it.po new file mode 100644 index 0000000000..eb129dd90c --- /dev/null +++ b/report_layout_config/i18n/it.po @@ -0,0 +1,248 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * report_layout_config +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 17.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-06-18 17:37+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\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.17\n" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +"!important;\n" +" }\n" +" }\n" +" tbody {\n" +" tr:last-child td {\n" +" border-bottom: 3px solid" +msgstr "" +"!important;\n" +" }\n" +" }\n" +" tbody {\n" +" tr:last-child td {\n" +" border-bottom: 3px solid" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +"&.o_clean_footer {\n" +" border-top: 3px solid" +msgstr "" +"&.o_clean_footer {\n" +" border-top: 3px solid" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +"&.o_report_layout_standard {\n" +" h2 {\n" +" color:" +msgstr "" +"&.o_report_layout_standard {\n" +" h2 {\n" +" color:" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +";\n" +" background-color:" +msgstr "" +";\n" +" background-color:" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +";\n" +" tr th {\n" +" border-top: 3px solid" +msgstr "" +";\n" +" tr th {\n" +" border-top: 3px solid" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +";\n" +" }\n" +" }\n" +" }\n" +" #total {\n" +" strong {\n" +" color:" +msgstr "" +";\n" +" }\n" +" }\n" +" }\n" +" #total {\n" +" strong {\n" +" color:" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +";\n" +" h4 {\n" +" color:" +msgstr "" +";\n" +" h4 {\n" +" color:" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +";\n" +" }\n" +" .pagenumber {\n" +" border: 3px solid" +msgstr "" +";\n" +" }\n" +" .pagenumber {\n" +" border: 3px solid" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +";\n" +" }\n" +" }\n" +" &.o_report_layout_clean {\n" +" h1, h2, h3 {\n" +" color:" +msgstr "" +";\n" +" }\n" +" }\n" +" &.o_report_layout_clean {\n" +" h1, h2, h3 {\n" +" color:" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +";\n" +" }\n" +" #informations strong {\n" +" color:" +msgstr "" +";\n" +" }\n" +" #informations strong {\n" +" color:" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +";\n" +" }\n" +" #total strong{\n" +" color:" +msgstr "" +";\n" +" }\n" +" #total strong{\n" +" color:" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +";\n" +" }\n" +" strong {\n" +" color:" +msgstr "" +";\n" +" }\n" +" strong {\n" +" color:" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +";\n" +" }\n" +" table {\n" +" thead {\n" +" color:" +msgstr "" +";\n" +" }\n" +" table {\n" +" thead {\n" +" color:" + +#. module: report_layout_config +#: model:ir.model,name:report_layout_config.model_res_company +msgid "Companies" +msgstr "Aziende" + +#. module: report_layout_config +#: model:ir.model,name:report_layout_config.model_base_document_layout +msgid "Company Document Layout" +msgstr "Schema documento azienda" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.external_clean_layout_images_template +#: model_terms:ir.ui.view,arch_db:report_layout_config.external_standard_layout_images_template +msgid "Footer logo" +msgstr "Logo pie pagina" + +#. module: report_layout_config +#: model:ir.model.fields,field_description:report_layout_config.field_base_document_layout__full_footer_img +#: model:ir.model.fields,field_description:report_layout_config.field_res_company__full_footer_img +msgid "Full footer image" +msgstr "Immagine completa pie pagina" + +#. module: report_layout_config +#: model:ir.model.fields,field_description:report_layout_config.field_base_document_layout__full_header_img +#: model:ir.model.fields,field_description:report_layout_config.field_res_company__full_header_img +msgid "Full header image" +msgstr "Immagine piena testata" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.external_clean_layout_images_template +#: model_terms:ir.ui.view,arch_db:report_layout_config.external_standard_layout_images_template +msgid "Logo" +msgstr "Logo" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.external_clean_layout_images_template +#: model_terms:ir.ui.view,arch_db:report_layout_config.external_standard_layout_images_template +msgid "Page: / " +msgstr "Pagina: / " + +#. module: report_layout_config +#: model:ir.model.fields,help:report_layout_config.field_base_document_layout__full_footer_img +msgid "Replaces whole footer, disables footer logo" +msgstr "Sostituisce il pie pagina completo, disabilita logo pie pagina" + +#. module: report_layout_config +#: model:ir.model.fields,help:report_layout_config.field_base_document_layout__full_header_img +msgid "Replaces whole header with image" +msgstr "Sostituisce la testata completa con una immagine" + +#. module: report_layout_config +#: model:ir.model.fields,help:report_layout_config.field_res_company__full_footer_img +msgid "This image will replace all footer." +msgstr "Questa immagine sostituirà tutti i pie pagina." + +#. module: report_layout_config +#: model:ir.model.fields,help:report_layout_config.field_res_company__full_header_img +msgid "This image will replace all header." +msgstr "Questa immagine sostituirà tutte le testate." diff --git a/report_layout_config/i18n/report_layout_config.pot b/report_layout_config/i18n/report_layout_config.pot new file mode 100644 index 0000000000..67fbbb271a --- /dev/null +++ b/report_layout_config/i18n/report_layout_config.pot @@ -0,0 +1,192 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * report_layout_config +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.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_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +"!important;\n" +" }\n" +" }\n" +" tbody {\n" +" tr:last-child td {\n" +" border-bottom: 3px solid" +msgstr "" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +"&.o_clean_footer {\n" +" border-top: 3px solid" +msgstr "" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +"&.o_report_layout_standard {\n" +" h2 {\n" +" color:" +msgstr "" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +";\n" +" background-color:" +msgstr "" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +";\n" +" tr th {\n" +" border-top: 3px solid" +msgstr "" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +";\n" +" }\n" +" }\n" +" }\n" +" #total {\n" +" strong {\n" +" color:" +msgstr "" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +";\n" +" h4 {\n" +" color:" +msgstr "" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +";\n" +" }\n" +" .pagenumber {\n" +" border: 3px solid" +msgstr "" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +";\n" +" }\n" +" }\n" +" &.o_report_layout_clean {\n" +" h1, h2, h3 {\n" +" color:" +msgstr "" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +";\n" +" }\n" +" #informations strong {\n" +" color:" +msgstr "" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +";\n" +" }\n" +" #total strong{\n" +" color:" +msgstr "" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +";\n" +" }\n" +" strong {\n" +" color:" +msgstr "" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.styles_company_report +msgid "" +";\n" +" }\n" +" table {\n" +" thead {\n" +" color:" +msgstr "" + +#. module: report_layout_config +#: model:ir.model,name:report_layout_config.model_res_company +msgid "Companies" +msgstr "" + +#. module: report_layout_config +#: model:ir.model,name:report_layout_config.model_base_document_layout +msgid "Company Document Layout" +msgstr "" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.external_clean_layout_images_template +#: model_terms:ir.ui.view,arch_db:report_layout_config.external_standard_layout_images_template +msgid "Footer logo" +msgstr "" + +#. module: report_layout_config +#: model:ir.model.fields,field_description:report_layout_config.field_base_document_layout__full_footer_img +#: model:ir.model.fields,field_description:report_layout_config.field_res_company__full_footer_img +msgid "Full footer image" +msgstr "" + +#. module: report_layout_config +#: model:ir.model.fields,field_description:report_layout_config.field_base_document_layout__full_header_img +#: model:ir.model.fields,field_description:report_layout_config.field_res_company__full_header_img +msgid "Full header image" +msgstr "" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.external_clean_layout_images_template +#: model_terms:ir.ui.view,arch_db:report_layout_config.external_standard_layout_images_template +msgid "Logo" +msgstr "" + +#. module: report_layout_config +#: model_terms:ir.ui.view,arch_db:report_layout_config.external_clean_layout_images_template +#: model_terms:ir.ui.view,arch_db:report_layout_config.external_standard_layout_images_template +msgid "Page: / " +msgstr "" + +#. module: report_layout_config +#: model:ir.model.fields,help:report_layout_config.field_base_document_layout__full_footer_img +msgid "Replaces whole footer, disables footer logo" +msgstr "" + +#. module: report_layout_config +#: model:ir.model.fields,help:report_layout_config.field_base_document_layout__full_header_img +msgid "Replaces whole header with image" +msgstr "" + +#. module: report_layout_config +#: model:ir.model.fields,help:report_layout_config.field_res_company__full_footer_img +msgid "This image will replace all footer." +msgstr "" + +#. module: report_layout_config +#: model:ir.model.fields,help:report_layout_config.field_res_company__full_header_img +msgid "This image will replace all header." +msgstr "" diff --git a/report_layout_config/models/__init__.py b/report_layout_config/models/__init__.py new file mode 100644 index 0000000000..290c7e1384 --- /dev/null +++ b/report_layout_config/models/__init__.py @@ -0,0 +1,2 @@ +from . import res_company +from . import base_document_layout diff --git a/report_layout_config/models/base_document_layout.py b/report_layout_config/models/base_document_layout.py new file mode 100644 index 0000000000..45f7460e9a --- /dev/null +++ b/report_layout_config/models/base_document_layout.py @@ -0,0 +1,26 @@ +# Copyright 2020 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import api, fields, models + + +class BaseDocumentLayout(models.TransientModel): + _inherit = "base.document.layout" + + full_header_img = fields.Binary( + related="company_id.full_header_img", + readonly=False, + help="Replaces whole header with image", + ) + full_footer_img = fields.Binary( + related="company_id.full_footer_img", + readonly=False, + help="Replaces whole footer, disables footer logo", + ) + + @api.depends( + "full_footer_img", + "full_header_img", + ) + def _compute_preview(self): + return super()._compute_preview() diff --git a/report_layout_config/models/res_company.py b/report_layout_config/models/res_company.py new file mode 100644 index 0000000000..f2ff4f40bc --- /dev/null +++ b/report_layout_config/models/res_company.py @@ -0,0 +1,19 @@ +# Copyright 2020 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class ResCompany(models.Model): + _inherit = "res.company" + + full_header_img = fields.Binary( + string="Full header image", + help="This image will replace all header.", + attachment=True, + ) + full_footer_img = fields.Binary( + string="Full footer image", + help="This image will replace all footer.", + attachment=True, + ) diff --git a/report_layout_config/pyproject.toml b/report_layout_config/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/report_layout_config/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/report_layout_config/readme/CONTRIBUTORS.md b/report_layout_config/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..ec91e9cba9 --- /dev/null +++ b/report_layout_config/readme/CONTRIBUTORS.md @@ -0,0 +1,3 @@ +- Thomas Nowicki \<\> +- Iryna Vyshnevska \<\> +- Do Anh Duy \<\> diff --git a/report_layout_config/readme/DESCRIPTION.md b/report_layout_config/readme/DESCRIPTION.md new file mode 100644 index 0000000000..a929211925 --- /dev/null +++ b/report_layout_config/readme/DESCRIPTION.md @@ -0,0 +1,2 @@ +This module provides new report template with possibility to add image +to replace header and footer. diff --git a/report_layout_config/readme/USAGE.md b/report_layout_config/readme/USAGE.md new file mode 100644 index 0000000000..4acfa807e1 --- /dev/null +++ b/report_layout_config/readme/USAGE.md @@ -0,0 +1,4 @@ +- In Setting/General Setting/Document Layout: + - Click on Configure Document Layout + - On the wizard choose Layout images + - Set the Full header image + Full footer image diff --git a/report_layout_config/static/description/icon.png b/report_layout_config/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/report_layout_config/static/description/icon.png differ diff --git a/report_layout_config/static/description/index.html b/report_layout_config/static/description/index.html new file mode 100644 index 0000000000..4dcf461217 --- /dev/null +++ b/report_layout_config/static/description/index.html @@ -0,0 +1,444 @@ + + + + + +README.rst + + + +
    + + + +Odoo Community Association + +
    +

    Report layout configuration

    + +

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

    +

    This module provides new report template with possibility to add image +to replace header and footer.

    +

    Table of contents

    + +
    +

    Usage

    +
      +
    • In Setting/General Setting/Document Layout:
        +
      • Click on Configure Document Layout
      • +
      • On the wizard choose Layout images
      • +
      • Set the Full header image + Full footer image
      • +
      +
    • +
    +
    +
    +

    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

    +
      +
    • Camptocamp
    • +
    +
    +
    +

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

    +

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

    +
    +
    +
    +
    + + diff --git a/report_layout_config/static/img/preview_standard.png b/report_layout_config/static/img/preview_standard.png new file mode 100644 index 0000000000..0bd596ed9b Binary files /dev/null and b/report_layout_config/static/img/preview_standard.png differ diff --git a/report_layout_config/static/pdf/preview_standard.pdf b/report_layout_config/static/pdf/preview_standard.pdf new file mode 100644 index 0000000000..4d53737685 Binary files /dev/null and b/report_layout_config/static/pdf/preview_standard.pdf differ diff --git a/report_layout_config/static/src/scss/style.scss b/report_layout_config/static/src/scss/style.scss new file mode 100644 index 0000000000..bc9b9350f9 --- /dev/null +++ b/report_layout_config/static/src/scss/style.scss @@ -0,0 +1,11 @@ +.footer-image { + max-width: 500px; +} + +.header-image { + margin-top: 22px; +} + +.header-full-image { + max-height: 60px; +} diff --git a/report_layout_config/templates/report_templates.xml b/report_layout_config/templates/report_templates.xml new file mode 100644 index 0000000000..a748cd1bc1 --- /dev/null +++ b/report_layout_config/templates/report_templates.xml @@ -0,0 +1,153 @@ + + + + + + + + diff --git a/report_layout_config/views/document_layout.xml b/report_layout_config/views/document_layout.xml new file mode 100644 index 0000000000..148c2a9ce2 --- /dev/null +++ b/report_layout_config/views/document_layout.xml @@ -0,0 +1,22 @@ + + + + base.document.layout + base.document.layout + + + + + + + + + max-width: 450px; + display: flex; + align-items: center; + justify-content: center; + + + + + diff --git a/report_pdf_form/i18n/it.po b/report_pdf_form/i18n/it.po index 393b68368e..9b38ba617b 100644 --- a/report_pdf_form/i18n/it.po +++ b/report_pdf_form/i18n/it.po @@ -88,8 +88,7 @@ msgstr "Valore context" #. module: report_pdf_form #: model:ir.model.fields,help:report_pdf_form.field_report_pdf_form__context -msgid "" -"Context dictionary as Python expression, empty by default (Default: {})" +msgid "Context dictionary as Python expression, empty by default (Default: {})" msgstr "" "Dizionario context come espressione Python, predefinito come vuoto (Default: " "{})" @@ -118,8 +117,8 @@ msgstr "Nome visualizzato" #. module: report_pdf_form #: model:ir.model.fields,help:report_pdf_form.field_report_pdf_form_field__odoo_field_value msgid "" -"Dot-separated path to field from the record, e.g. partner_id.name, or python" -" code" +"Dot-separated path to field from the record, e.g. partner_id.name, or python " +"code" msgstr "" "Percorso separato da punti al campo dal record, ad esempio partner_id.name o " "codice Python" @@ -153,6 +152,11 @@ msgstr "Codifica" msgid "Encoding to be applied to the generated CSV file. e.g. cp932" msgstr "Codifica da applicare al file CSV generato. Es. cp932" +#. module: report_pdf_form +#: model:ir.model.fields,help:report_pdf_form.field_report_pdf_form__text_encoding +msgid "Encoding to be applied to the generated Text file. e.g. cp932" +msgstr "" + #. module: report_pdf_form #: model:ir.model.fields,field_description:report_pdf_form.field_report_pdf_form__xml_id msgid "External ID" @@ -218,6 +222,13 @@ msgstr "" "Se non è selezionato nulla, l'esportazione del CSV fallirà con un messaggio " "di errore qando c'è un carattere che non può essere codificato." +#. module: report_pdf_form +#: model:ir.model.fields,help:report_pdf_form.field_report_pdf_form__text_encode_error_handling +msgid "" +"If nothing is selected, text export will fail with an error message when " +"there is a character that fail to be encoded." +msgstr "" + #. module: report_pdf_form #: model:ir.model.fields,help:report_pdf_form.field_report_pdf_form__multi msgid "" @@ -229,8 +240,7 @@ msgstr "" #. module: report_pdf_form #: model:ir.model.fields,help:report_pdf_form.field_report_pdf_form__domain -msgid "" -"If set, the action will only appear on records that matches the domain." +msgid "If set, the action will only appear on records that matches the domain." msgstr "" "Se impostata, l'azione apparirà solo sui record che corrispondono al dominio." @@ -254,6 +264,11 @@ msgstr "Ultimo aggiornamento di" msgid "Last Updated on" msgstr "Ultimo aggiornamento il" +#. module: report_pdf_form +#: model:ir.model.fields,field_description:report_pdf_form.field_report_pdf_form__line_ending +msgid "Line Ending" +msgstr "" + #. module: report_pdf_form #: model:ir.model,name:report_pdf_form.model_report_pdf_form_field msgid "Mapping of Odoo field to PDF form field" @@ -298,8 +313,8 @@ msgstr "Su documenti multipli" #. module: report_pdf_form #: model:ir.model.fields,help:report_pdf_form.field_report_pdf_form__help msgid "" -"Optional help text for the users with a description of the target view, such" -" as its usage and purpose." +"Optional help text for the users with a description of the target view, such " +"as its usage and purpose." msgstr "" "Testo di aiuto opzionale per l'utente con una descrizione della vista " "obiettivo, come il suo utilizzo e obiettivo." @@ -401,6 +416,13 @@ msgstr "Variabile riutilizzabile da valutare nel codice dei campi del modulo" msgid "Save as Attachment Prefix" msgstr "Salva come prefisso allegato" +#. module: report_pdf_form +#: model:ir.model.fields,help:report_pdf_form.field_report_pdf_form__line_ending +msgid "" +"Select the type of line ending in case the report needs to be output with " +"other line ending than 'LF'." +msgstr "" + #. module: report_pdf_form #: model:ir.model.fields,help:report_pdf_form.field_report_pdf_form__binding_model_id msgid "" @@ -420,6 +442,16 @@ msgstr "Testo statico" msgid "Template Name" msgstr "Nome modello" +#. module: report_pdf_form +#: model:ir.model.fields,field_description:report_pdf_form.field_report_pdf_form__text_encode_error_handling +msgid "Text Encode Error Handling" +msgstr "" + +#. module: report_pdf_form +#: model:ir.model.fields,field_description:report_pdf_form.field_report_pdf_form__text_encoding +msgid "Text Encoding" +msgstr "" + #. module: report_pdf_form #: model:ir.model.fields,help:report_pdf_form.field_report_pdf_form__report_file msgid "" @@ -451,13 +483,14 @@ msgstr "Esistono due modi per recuperare il valore dall'oggetto:" #: model:ir.model.fields,help:report_pdf_form.field_report_pdf_form__footer_html msgid "" "This HTML will be displayed in the footer of this report.\n" -"It's recommended to change Paper Format to a new one that fits correctly to this report by adjusting 'Bottom Margin (mm)' accordingly." +"It's recommended to change Paper Format to a new one that fits correctly to " +"this report by adjusting 'Bottom Margin (mm)' accordingly." msgstr "" -"Questo codice HTML verrà visualizzato nel piè di pagina di questo resoconto." -"\n" +"Questo codice HTML verrà visualizzato nel piè di pagina di questo " +"resoconto.\n" "Si consiglia di modificare il formato cartaceo in modo che si adatti " -"correttamente a questo resoconto, modificando di conseguenza il " -"\"Margine inferiore (mm)\"." +"correttamente a questo resoconto, modificando di conseguenza il \"Margine " +"inferiore (mm)\"." #. module: report_pdf_form #: model:ir.model.fields,help:report_pdf_form.field_report_pdf_form__attachment diff --git a/report_pdf_form/i18n/nl.po b/report_pdf_form/i18n/nl.po index b6ad41c17f..3683b19c1c 100644 --- a/report_pdf_form/i18n/nl.po +++ b/report_pdf_form/i18n/nl.po @@ -88,9 +88,9 @@ msgstr "Contextwaarde" #. module: report_pdf_form #: model:ir.model.fields,help:report_pdf_form.field_report_pdf_form__context -msgid "" -"Context dictionary as Python expression, empty by default (Default: {})" -msgstr "Context dictionary als Python expressie, standaard leeg (Standaard: {})" +msgid "Context dictionary as Python expression, empty by default (Default: {})" +msgstr "" +"Context dictionary als Python expressie, standaard leeg (Standaard: {})" #. module: report_pdf_form #: model:ir.model.fields,field_description:report_pdf_form.field_report_pdf_form__create_uid @@ -116,8 +116,8 @@ msgstr "Schermnaam" #. module: report_pdf_form #: model:ir.model.fields,help:report_pdf_form.field_report_pdf_form_field__odoo_field_value msgid "" -"Dot-separated path to field from the record, e.g. partner_id.name, or python" -" code" +"Dot-separated path to field from the record, e.g. partner_id.name, or python " +"code" msgstr "" "Pad naar veld gescheiden door punten, bijv. partner_id.name, of python code" @@ -153,6 +153,11 @@ msgstr "" "Codering die moet worden toegepast op het gegenereerde CSV-bestand, bijv. " "cp932" +#. module: report_pdf_form +#: model:ir.model.fields,help:report_pdf_form.field_report_pdf_form__text_encoding +msgid "Encoding to be applied to the generated Text file. e.g. cp932" +msgstr "" + #. module: report_pdf_form #: model:ir.model.fields,field_description:report_pdf_form.field_report_pdf_form__xml_id msgid "External ID" @@ -218,6 +223,13 @@ msgstr "" "Indien niets is geselecteerd, zal de CSV-export mislukken met een " "foutmelding wanneer een teken niet kan worden gecodeerd." +#. module: report_pdf_form +#: model:ir.model.fields,help:report_pdf_form.field_report_pdf_form__text_encode_error_handling +msgid "" +"If nothing is selected, text export will fail with an error message when " +"there is a character that fail to be encoded." +msgstr "" + #. module: report_pdf_form #: model:ir.model.fields,help:report_pdf_form.field_report_pdf_form__multi msgid "" @@ -229,8 +241,7 @@ msgstr "" #. module: report_pdf_form #: model:ir.model.fields,help:report_pdf_form.field_report_pdf_form__domain -msgid "" -"If set, the action will only appear on records that matches the domain." +msgid "If set, the action will only appear on records that matches the domain." msgstr "" "Indien ingesteld, verschijnt de actie alleen bij records die aan het domein " "voldoen." @@ -255,6 +266,11 @@ msgstr "Laatst bijgewerkt door" msgid "Last Updated on" msgstr "Laatst bijgewerkt op" +#. module: report_pdf_form +#: model:ir.model.fields,field_description:report_pdf_form.field_report_pdf_form__line_ending +msgid "Line Ending" +msgstr "" + #. module: report_pdf_form #: model:ir.model,name:report_pdf_form.model_report_pdf_form_field msgid "Mapping of Odoo field to PDF form field" @@ -299,8 +315,8 @@ msgstr "Op meerdere doc." #. module: report_pdf_form #: model:ir.model.fields,help:report_pdf_form.field_report_pdf_form__help msgid "" -"Optional help text for the users with a description of the target view, such" -" as its usage and purpose." +"Optional help text for the users with a description of the target view, such " +"as its usage and purpose." msgstr "" "Optionele helptekst voor de gebruikers met een beschrijving van de " "doelweergave, zoals het gebruik en het doel ervan." @@ -404,6 +420,13 @@ msgstr "" msgid "Save as Attachment Prefix" msgstr "Opslaan als bijlage voorvoegsel" +#. module: report_pdf_form +#: model:ir.model.fields,help:report_pdf_form.field_report_pdf_form__line_ending +msgid "" +"Select the type of line ending in case the report needs to be output with " +"other line ending than 'LF'." +msgstr "" + #. module: report_pdf_form #: model:ir.model.fields,help:report_pdf_form.field_report_pdf_form__binding_model_id msgid "" @@ -423,6 +446,16 @@ msgstr "Statische tekst" msgid "Template Name" msgstr "Sjabloonnaam" +#. module: report_pdf_form +#: model:ir.model.fields,field_description:report_pdf_form.field_report_pdf_form__text_encode_error_handling +msgid "Text Encode Error Handling" +msgstr "" + +#. module: report_pdf_form +#: model:ir.model.fields,field_description:report_pdf_form.field_report_pdf_form__text_encoding +msgid "Text Encoding" +msgstr "" + #. module: report_pdf_form #: model:ir.model.fields,help:report_pdf_form.field_report_pdf_form__report_file msgid "" @@ -454,7 +487,8 @@ msgstr "Er zijn twee manieren om een waarde uit het object op te halen:" #: model:ir.model.fields,help:report_pdf_form.field_report_pdf_form__footer_html msgid "" "This HTML will be displayed in the footer of this report.\n" -"It's recommended to change Paper Format to a new one that fits correctly to this report by adjusting 'Bottom Margin (mm)' accordingly." +"It's recommended to change Paper Format to a new one that fits correctly to " +"this report by adjusting 'Bottom Margin (mm)' accordingly." msgstr "" "Deze HTML wordt weergegeven in de voettekst van dit rapport.\n" "Het wordt aanbevolen om het papierformaat te wijzigen naar een formaat dat " diff --git a/report_pdf_form/i18n/report_pdf_form.pot b/report_pdf_form/i18n/report_pdf_form.pot index 591bbb1993..024398e03b 100644 --- a/report_pdf_form/i18n/report_pdf_form.pot +++ b/report_pdf_form/i18n/report_pdf_form.pot @@ -139,6 +139,11 @@ msgstr "" msgid "Encoding to be applied to the generated CSV file. e.g. cp932" msgstr "" +#. module: report_pdf_form +#: model:ir.model.fields,help:report_pdf_form.field_report_pdf_form__text_encoding +msgid "Encoding to be applied to the generated Text file. e.g. cp932" +msgstr "" + #. module: report_pdf_form #: model:ir.model.fields,field_description:report_pdf_form.field_report_pdf_form__xml_id msgid "External ID" @@ -200,6 +205,13 @@ msgid "" "there is a character that fail to be encoded." msgstr "" +#. module: report_pdf_form +#: model:ir.model.fields,help:report_pdf_form.field_report_pdf_form__text_encode_error_handling +msgid "" +"If nothing is selected, text export will fail with an error message when " +"there is a character that fail to be encoded." +msgstr "" + #. module: report_pdf_form #: model:ir.model.fields,help:report_pdf_form.field_report_pdf_form__multi msgid "" @@ -233,6 +245,11 @@ msgstr "" msgid "Last Updated on" msgstr "" +#. module: report_pdf_form +#: model:ir.model.fields,field_description:report_pdf_form.field_report_pdf_form__line_ending +msgid "Line Ending" +msgstr "" + #. module: report_pdf_form #: model:ir.model,name:report_pdf_form.model_report_pdf_form_field msgid "Mapping of Odoo field to PDF form field" @@ -375,6 +392,13 @@ msgstr "" msgid "Save as Attachment Prefix" msgstr "" +#. module: report_pdf_form +#: model:ir.model.fields,help:report_pdf_form.field_report_pdf_form__line_ending +msgid "" +"Select the type of line ending in case the report needs to be output with " +"other line ending than 'LF'." +msgstr "" + #. module: report_pdf_form #: model:ir.model.fields,help:report_pdf_form.field_report_pdf_form__binding_model_id msgid "" @@ -392,6 +416,16 @@ msgstr "" msgid "Template Name" msgstr "" +#. module: report_pdf_form +#: model:ir.model.fields,field_description:report_pdf_form.field_report_pdf_form__text_encode_error_handling +msgid "Text Encode Error Handling" +msgstr "" + +#. module: report_pdf_form +#: model:ir.model.fields,field_description:report_pdf_form.field_report_pdf_form__text_encoding +msgid "Text Encoding" +msgstr "" + #. module: report_pdf_form #: model:ir.model.fields,help:report_pdf_form.field_report_pdf_form__report_file msgid "" diff --git a/report_text_format_option/README.rst b/report_text_format_option/README.rst new file mode 100644 index 0000000000..b0082f53d1 --- /dev/null +++ b/report_text_format_option/README.rst @@ -0,0 +1,120 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +========================= +Report Text Format Option +========================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:49a62de046c4f37a11ee0f6c09678a6392bfc37c92f0107109d8ca3a1167d9dc + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/license-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github + :target: https://github.com/OCA/reporting-engine/tree/18.0/report_text_format_option + :alt: OCA/reporting-engine +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/reporting-engine-18-0/reporting-engine-18-0-report_text_format_option + :alt: Translate me on Weblate +.. |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=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This is a technical module designed to add encoding fields to the +ir.actions.report model and is applied to Text type reports. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +In case the exported report should be encoded in another system than +UTF-8, following fields of the report record (*Settings > Technical > +Reports*) should be populated accordingly. + +- Text Encoding: set an encoding system (such as cp932) +- Text Encode Error Handling: select 'Ignore' or 'Replace' as necessary. + + - 'Ignore': in case of an encoding error, the problematic character + will be removed from the exported file. + - 'Replace': in case of an encoding error, the problematic character + will be replaced with '?' symbol. + - Leaving the field blank: in case of an encoding error, the report + generation fails with an error message. + +- Line Ending: Select the type of line ending, 'CRLF' or 'CR', as + necessary. + + - 'CRLF': 'Carriage Return' + 'Line Feed' (Windows) + - 'CR': 'Carriage Return' (classic Mac OS) + - Leaving this field blank defaults to using 'LF' (Line Feed), the + default behavior of Odoo. + +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 +------- + +* Quartile + +Contributors +------------ + +- Quartile + + - Aung Ko Ko Lin + - Yoshi Tashiro + +Maintainers +----------- + +This module is maintained by the OCA. + +.. 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. + +.. |maintainer-yostashiro| image:: https://github.com/yostashiro.png?size=40px + :target: https://github.com/yostashiro + :alt: yostashiro +.. |maintainer-aungkokolin1997| image:: https://github.com/aungkokolin1997.png?size=40px + :target: https://github.com/aungkokolin1997 + :alt: aungkokolin1997 + +Current `maintainers `__: + +|maintainer-yostashiro| |maintainer-aungkokolin1997| + +This module is part of the `OCA/reporting-engine `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/report_text_format_option/__init__.py b/report_text_format_option/__init__.py new file mode 100644 index 0000000000..0650744f6b --- /dev/null +++ b/report_text_format_option/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/report_text_format_option/__manifest__.py b/report_text_format_option/__manifest__.py new file mode 100644 index 0000000000..21eab39b8f --- /dev/null +++ b/report_text_format_option/__manifest__.py @@ -0,0 +1,15 @@ +# Copyright 2024 Quartile (https://www.quartile.co) +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). +{ + "name": "Report Text Format Option", + "author": "Quartile, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/reporting-engine", + "category": "Reporting", + "version": "18.0.1.0.0", + "license": "LGPL-3", + "depends": ["base"], + "data": ["views/ir_actions_report_views.xml"], + "maintainers": ["yostashiro", "aungkokolin1997"], + "demo": ["demo/report_demo.xml"], + "installable": True, +} diff --git a/report_text_format_option/demo/report_demo.xml b/report_text_format_option/demo/report_demo.xml new file mode 100644 index 0000000000..7fd6945283 --- /dev/null +++ b/report_text_format_option/demo/report_demo.xml @@ -0,0 +1,18 @@ + + + + Demo Text Report + res.partner + qweb-text + report_text_format_option.demo_report_template + report_text_format_option.demo_report_template + + + + + + diff --git a/report_text_format_option/i18n/it.po b/report_text_format_option/i18n/it.po new file mode 100644 index 0000000000..80b9c0de38 --- /dev/null +++ b/report_text_format_option/i18n/it.po @@ -0,0 +1,93 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * report_text_format_option +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-06-07 12:34+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\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.17\n" + +#. module: report_text_format_option +#: model:ir.model.fields.selection,name:report_text_format_option.selection__ir_actions_report__line_ending__cr +msgid "CR (\\r)" +msgstr "CR (\\r)" + +#. module: report_text_format_option +#: model:ir.model.fields.selection,name:report_text_format_option.selection__ir_actions_report__line_ending__crlf +msgid "CRLF (\\r\\n)" +msgstr "" +"CRLF (\\r\\n" +")" + +#. module: report_text_format_option +#: model:ir.actions.report,name:report_text_format_option.action_report_demo +msgid "Demo Text Report" +msgstr "Resoconto testo demo" + +#. module: report_text_format_option +#: model:ir.model.fields,help:report_text_format_option.field_ir_actions_report__text_encoding +msgid "Encoding to be applied to the generated Text file. e.g. cp932" +msgstr "Codifica da applicare al file testo generato. Es. cp932" + +#. module: report_text_format_option +#: model_terms:ir.ui.view,arch_db:report_text_format_option.demo_report_template +msgid "Hello," +msgstr "Salve," + +#. module: report_text_format_option +#: model:ir.model.fields,help:report_text_format_option.field_ir_actions_report__text_encode_error_handling +msgid "" +"If nothing is selected, text export will fail with an error message when " +"there is a character that fail to be encoded." +msgstr "" +"Se non viene selezionato nulla, l'esportazione del testo fallirà con un " +"messaggio di errore quando è presente un carattere che non può essere " +"codificato." + +#. module: report_text_format_option +#: model:ir.model.fields.selection,name:report_text_format_option.selection__ir_actions_report__text_encode_error_handling__ignore +msgid "Ignore" +msgstr "Ignora" + +#. module: report_text_format_option +#: model:ir.model.fields,field_description:report_text_format_option.field_ir_actions_report__line_ending +msgid "Line Ending" +msgstr "Fine riga" + +#. module: report_text_format_option +#: model:ir.model.fields.selection,name:report_text_format_option.selection__ir_actions_report__text_encode_error_handling__replace +msgid "Replace" +msgstr "Sostituisce" + +#. module: report_text_format_option +#: model:ir.model,name:report_text_format_option.model_ir_actions_report +msgid "Report Action" +msgstr "Azione resoconto" + +#. module: report_text_format_option +#: model:ir.model.fields,help:report_text_format_option.field_ir_actions_report__line_ending +msgid "" +"Select the type of line ending in case the report needs to be output with " +"other line ending than 'LF'." +msgstr "" +"Selezionare il tipo di fine riga nel caso il resoconto richieda di essere " +"emesso con fine riga diverso da 'LF'." + +#. module: report_text_format_option +#: model:ir.model.fields,field_description:report_text_format_option.field_ir_actions_report__text_encode_error_handling +msgid "Text Encode Error Handling" +msgstr "Gestione errore codifica testo" + +#. module: report_text_format_option +#: model:ir.model.fields,field_description:report_text_format_option.field_ir_actions_report__text_encoding +msgid "Text Encoding" +msgstr "Codifica testo" diff --git a/report_text_format_option/i18n/report_text_format_option.pot b/report_text_format_option/i18n/report_text_format_option.pot new file mode 100644 index 0000000000..e211bdf55a --- /dev/null +++ b/report_text_format_option/i18n/report_text_format_option.pot @@ -0,0 +1,83 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * report_text_format_option +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.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_text_format_option +#: model:ir.model.fields.selection,name:report_text_format_option.selection__ir_actions_report__line_ending__cr +msgid "CR (\\r)" +msgstr "" + +#. module: report_text_format_option +#: model:ir.model.fields.selection,name:report_text_format_option.selection__ir_actions_report__line_ending__crlf +msgid "CRLF (\\r\\n)" +msgstr "" + +#. module: report_text_format_option +#: model:ir.actions.report,name:report_text_format_option.action_report_demo +msgid "Demo Text Report" +msgstr "" + +#. module: report_text_format_option +#: model:ir.model.fields,help:report_text_format_option.field_ir_actions_report__text_encoding +msgid "Encoding to be applied to the generated Text file. e.g. cp932" +msgstr "" + +#. module: report_text_format_option +#: model_terms:ir.ui.view,arch_db:report_text_format_option.demo_report_template +msgid "Hello," +msgstr "" + +#. module: report_text_format_option +#: model:ir.model.fields,help:report_text_format_option.field_ir_actions_report__text_encode_error_handling +msgid "" +"If nothing is selected, text export will fail with an error message when " +"there is a character that fail to be encoded." +msgstr "" + +#. module: report_text_format_option +#: model:ir.model.fields.selection,name:report_text_format_option.selection__ir_actions_report__text_encode_error_handling__ignore +msgid "Ignore" +msgstr "" + +#. module: report_text_format_option +#: model:ir.model.fields,field_description:report_text_format_option.field_ir_actions_report__line_ending +msgid "Line Ending" +msgstr "" + +#. module: report_text_format_option +#: model:ir.model.fields.selection,name:report_text_format_option.selection__ir_actions_report__text_encode_error_handling__replace +msgid "Replace" +msgstr "" + +#. module: report_text_format_option +#: model:ir.model,name:report_text_format_option.model_ir_actions_report +msgid "Report Action" +msgstr "" + +#. module: report_text_format_option +#: model:ir.model.fields,help:report_text_format_option.field_ir_actions_report__line_ending +msgid "" +"Select the type of line ending in case the report needs to be output with " +"other line ending than 'LF'." +msgstr "" + +#. module: report_text_format_option +#: model:ir.model.fields,field_description:report_text_format_option.field_ir_actions_report__text_encode_error_handling +msgid "Text Encode Error Handling" +msgstr "" + +#. module: report_text_format_option +#: model:ir.model.fields,field_description:report_text_format_option.field_ir_actions_report__text_encoding +msgid "Text Encoding" +msgstr "" diff --git a/report_text_format_option/models/__init__.py b/report_text_format_option/models/__init__.py new file mode 100644 index 0000000000..a248cf2162 --- /dev/null +++ b/report_text_format_option/models/__init__.py @@ -0,0 +1 @@ +from . import ir_actions_report diff --git a/report_text_format_option/models/ir_actions_report.py b/report_text_format_option/models/ir_actions_report.py new file mode 100644 index 0000000000..a4a9fe91fc --- /dev/null +++ b/report_text_format_option/models/ir_actions_report.py @@ -0,0 +1,42 @@ +# Copyright 2024 Quartile (https://www.quartile.co) +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). + +from odoo import api, fields, models + + +class IrActionReport(models.Model): + _inherit = "ir.actions.report" + + text_encoding = fields.Char( + help="Encoding to be applied to the generated Text file. e.g. cp932" + ) + text_encode_error_handling = fields.Selection( + selection=[("ignore", "Ignore"), ("replace", "Replace")], + help="If nothing is selected, text export will fail with an error message when " + "there is a character that fail to be encoded.", + ) + line_ending = fields.Selection( + [("crlf", "CRLF (\\r\\n)"), ("cr", "CR (\\r)")], + help="Select the type of line ending in case the report needs " + "to be output with other line ending than 'LF'.", + ) + + @api.model + def _render_qweb_text(self, report_ref, docids, data=None): + content, content_type = super()._render_qweb_text(report_ref, docids, data) + report = self._get_report(report_ref) + if not report.text_encoding and not report.line_ending: + return content, content_type + content_str = content.decode("utf-8") + if report.line_ending == "crlf": + content_str = content_str.replace("\n", "\r\n") + elif report.line_ending == "cr": + content_str = content_str.replace("\n", "\r") + # If specific encoding is set on the report, + # use it; otherwise, fallback to utf-8 + encoding = report.text_encoding or "utf-8" + encode_options = {} + if report.text_encode_error_handling: + encode_options["errors"] = report.text_encode_error_handling + content = content_str.encode(encoding, **encode_options) + return content, content_type diff --git a/report_text_format_option/pyproject.toml b/report_text_format_option/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/report_text_format_option/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/report_text_format_option/readme/CONFIGURE.md b/report_text_format_option/readme/CONFIGURE.md new file mode 100644 index 0000000000..53a26fe27e --- /dev/null +++ b/report_text_format_option/readme/CONFIGURE.md @@ -0,0 +1,18 @@ +In case the exported report should be encoded in another system than +UTF-8, following fields of the report record (*Settings \> Technical \> +Reports*) should be populated accordingly. + +- Text Encoding: set an encoding system (such as cp932) +- Text Encode Error Handling: select 'Ignore' or 'Replace' as necessary. + - 'Ignore': in case of an encoding error, the problematic character + will be removed from the exported file. + - 'Replace': in case of an encoding error, the problematic character + will be replaced with '?' symbol. + - Leaving the field blank: in case of an encoding error, the report + generation fails with an error message. +- Line Ending: Select the type of line ending, 'CRLF' or 'CR', as + necessary. + - 'CRLF': 'Carriage Return' + 'Line Feed' (Windows) + - 'CR': 'Carriage Return' (classic Mac OS) + - Leaving this field blank defaults to using 'LF' (Line Feed), the + default behavior of Odoo. diff --git a/report_text_format_option/readme/CONTRIBUTORS.md b/report_text_format_option/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..f6444ad9ec --- /dev/null +++ b/report_text_format_option/readme/CONTRIBUTORS.md @@ -0,0 +1,3 @@ +- Quartile \<\> + - Aung Ko Ko Lin + - Yoshi Tashiro diff --git a/report_text_format_option/readme/DESCRIPTION.md b/report_text_format_option/readme/DESCRIPTION.md new file mode 100644 index 0000000000..b85c101397 --- /dev/null +++ b/report_text_format_option/readme/DESCRIPTION.md @@ -0,0 +1,2 @@ +This is a technical module designed to add encoding fields to the +ir.actions.report model and is applied to Text type reports. diff --git a/report_text_format_option/static/description/icon.png b/report_text_format_option/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/report_text_format_option/static/description/icon.png differ diff --git a/report_text_format_option/static/description/index.html b/report_text_format_option/static/description/index.html new file mode 100644 index 0000000000..eb91f44499 --- /dev/null +++ b/report_text_format_option/static/description/index.html @@ -0,0 +1,463 @@ + + + + + +README.rst + + + +
    + + + +Odoo Community Association + +
    +

    Report Text Format Option

    + +

    Beta License: LGPL-3 OCA/reporting-engine Translate me on Weblate Try me on Runboat

    +

    This is a technical module designed to add encoding fields to the +ir.actions.report model and is applied to Text type reports.

    +

    Table of contents

    + +
    +

    Configuration

    +

    In case the exported report should be encoded in another system than +UTF-8, following fields of the report record (Settings > Technical > +Reports) should be populated accordingly.

    +
      +
    • Text Encoding: set an encoding system (such as cp932)
    • +
    • Text Encode Error Handling: select ‘Ignore’ or ‘Replace’ as necessary.
        +
      • ‘Ignore’: in case of an encoding error, the problematic character +will be removed from the exported file.
      • +
      • ‘Replace’: in case of an encoding error, the problematic character +will be replaced with ‘?’ symbol.
      • +
      • Leaving the field blank: in case of an encoding error, the report +generation fails with an error message.
      • +
      +
    • +
    • Line Ending: Select the type of line ending, ‘CRLF’ or ‘CR’, as +necessary.
        +
      • ‘CRLF’: ‘Carriage Return’ + ‘Line Feed’ (Windows)
      • +
      • ‘CR’: ‘Carriage Return’ (classic Mac OS)
      • +
      • Leaving this field blank defaults to using ‘LF’ (Line Feed), the +default behavior of Odoo.
      • +
      +
    • +
    +
    +
    +

    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

    +
      +
    • Quartile
    • +
    +
    +
    +

    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.

    +

    Current maintainers:

    +

    yostashiro aungkokolin1997

    +

    This module is part of the OCA/reporting-engine project on GitHub.

    +

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

    +
    +
    +
    +
    + + diff --git a/report_text_format_option/tests/__init__.py b/report_text_format_option/tests/__init__.py new file mode 100644 index 0000000000..623710424b --- /dev/null +++ b/report_text_format_option/tests/__init__.py @@ -0,0 +1 @@ +from . import test_report_format_option diff --git a/report_text_format_option/tests/test_report_format_option.py b/report_text_format_option/tests/test_report_format_option.py new file mode 100644 index 0000000000..ccc910c7ac --- /dev/null +++ b/report_text_format_option/tests/test_report_format_option.py @@ -0,0 +1,54 @@ +# Copyright 2024 Quartile (https://www.quartile.co) +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). + + +from odoo.tests.common import TransactionCase + + +class TestReportFormatOption(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.demo_report = cls.env.ref( + "report_text_format_option.action_report_demo" + ).with_context(lang="en_US") + cls.partner = cls.env["res.partner"].create({"name": "Odoo Test Partner"}) + + def test_report_default_encoding(self): + content, content_type = self.demo_report._render_qweb_text( + self.demo_report.id, [self.partner.id] + ) + self.assertTrue(content, "Report content should not be empty") + + def test_report_encoding_crlf(self): + # Set line ending to CRLF + self.demo_report.line_ending = "crlf" + content, content_type = self.demo_report._render_qweb_text( + self.demo_report.id, [self.partner.id] + ) + content_str = content.decode("utf-8") + self.assertIn("\r\n", content_str, "Line endings should be CRLF") + + def test_report_encoding_cr(self): + # Set line ending to CR + self.demo_report.line_ending = "cr" + content, content_type = self.demo_report._render_qweb_text( + self.demo_report.id, [self.partner.id] + ) + content_str = content.decode("utf-8") + self.assertIn("\r", content_str, "Line endings should be CR and not contain LF") + + def test_report_encoding_shiftjis(self): + # Example: Testing with Shift-JIS encoding for Japanese characters + self.demo_report.text_encoding = "shift_jis" + self.partner.name = "テストパートナー" + content, content_type = self.demo_report._render_qweb_text( + self.demo_report.id, [self.partner.id] + ) + # Decode content to verify Japanese characters are correctly handled + content_str = content.decode("shift_jis") + self.assertIn( + "テストパートナー", + content_str, + "Japanese characters should be correctly encoded in Shift-JIS", + ) diff --git a/report_text_format_option/views/ir_actions_report_views.xml b/report_text_format_option/views/ir_actions_report_views.xml new file mode 100644 index 0000000000..91ad619b49 --- /dev/null +++ b/report_text_format_option/views/ir_actions_report_views.xml @@ -0,0 +1,18 @@ + + + + ir.actions.report + ir.actions.report + + + + + + + + + + diff --git a/setup/_metapackage/pyproject.toml b/setup/_metapackage/pyproject.toml index 459bdf6922..1113fa16fb 100644 --- a/setup/_metapackage/pyproject.toml +++ b/setup/_metapackage/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "odoo-addons-oca-reporting-engine" -version = "18.0.20260202.0" +version = "18.0.20260320.1" dependencies = [ "odoo-addon-base_comment_template==18.0.*", "odoo-addon-bi_sql_editor==18.0.*", @@ -9,6 +9,7 @@ dependencies = [ "odoo-addon-report_csv==18.0.*", "odoo-addon-report_display_name_in_footer==18.0.*", "odoo-addon-report_footer_html==18.0.*", + "odoo-addon-report_layout_config==18.0.*", "odoo-addon-report_partner_address==18.0.*", "odoo-addon-report_pdf_form==18.0.*", "odoo-addon-report_pdf_zip_download==18.0.*", @@ -22,6 +23,7 @@ dependencies = [ "odoo-addon-report_qweb_pdf_cover==18.0.*", "odoo-addon-report_qweb_pdf_watermark==18.0.*", "odoo-addon-report_substitute==18.0.*", + "odoo-addon-report_text_format_option==18.0.*", "odoo-addon-report_wkhtmltopdf_param==18.0.*", "odoo-addon-report_xlsx==18.0.*", "odoo-addon-report_xlsx_helper==18.0.*",