diff --git a/report_qweb_parameter/README.rst b/report_qweb_parameter/README.rst index e3659433..de4169f3 100644 --- a/report_qweb_parameter/README.rst +++ b/report_qweb_parameter/README.rst @@ -1,11 +1,30 @@ -.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html - :alt: License: AGPL-3 - ===================== Report QWeb Parameter ===================== +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github + :target: https://github.com/OCA/reporting-engine/tree/13.0/report_qweb_parameter + :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-13-0/reporting-engine-13-0-report_qweb_parameter + :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/13.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + This module allows you to add new parameters on QWeb reports. Currently, we have defined a field maximum on a report and a validation of maximal and minimal size. @@ -14,6 +33,10 @@ XML are sometimes XSD dependant and we must validate its format. For example, in spanish facturae (http://www.facturae.gob.es/Paginas/Index.aspx), where length and format must be validated in several fields in order to send an invoice. +**Table of contents** + +.. contents:: + :local: Usage ===== @@ -22,44 +45,47 @@ Usage #. Add a t-minlength attribute on report template fields that will check the min length #. Add a t-maxlength attribute on report template fields that will check the max length -.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas - :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/143/11.0 - - Bug Tracker =========== -Bugs are tracked on `GitHub Issues -`_. In case of trouble, please -check there if your issue has already been reported. If you spotted it first, -help us smashing it by providing a detailed and welcomed feedback. +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. Credits ======= -Images ------- +Authors +~~~~~~~ -* Odoo Community Association: `Icon `_. +* Creu Blanca +* Tecnativa Contributors ------------- +~~~~~~~~~~~~ * Enric Tobella +* `Tecnativa `_: -Maintainer ----------- + * Carlos Roca + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. .. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association :target: https://odoo-community.org -This module is maintained by the OCA. - OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -To contribute to this module, please visit https://odoo-community.org. +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_qweb_parameter/__manifest__.py b/report_qweb_parameter/__manifest__.py index ec86cd92..d8e5dc6c 100644 --- a/report_qweb_parameter/__manifest__.py +++ b/report_qweb_parameter/__manifest__.py @@ -3,13 +3,13 @@ { "name": "Report QWeb Parameter", - "version": "12.0.1.0.0", + "version": "13.0.1.0.0", "license": "AGPL-3", "summary": """ Add new parameters for qweb templates in order to reduce field length and check minimal length """, - "author": "Creu Blanca," "Odoo Community Association (OCA)", + "author": "Creu Blanca, Odoo Community Association (OCA)", "website": "https://github.com/oca/reporting-engine", "category": "Technical Settings", "depends": ["web"], diff --git a/report_qweb_parameter/i18n/es.po b/report_qweb_parameter/i18n/es.po new file mode 100644 index 00000000..62e1dbd7 --- /dev/null +++ b/report_qweb_parameter/i18n/es.po @@ -0,0 +1,40 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * report_qweb_parameter +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"X-Generator: Poedit 2.0.6\n" +"Last-Translator: Carlos \n" +"Language: es\n" + +#. module: report_qweb_parameter +#: model:ir.actions.report,name:report_qweb_parameter.test_report_length_report_id +msgid "Length Report" +msgstr "Longitud del informe" + +#. module: report_qweb_parameter +#: code:addons/report_qweb_parameter/models/ir_qweb.py:16 +#, python-format +msgid "Length cannot be less than %s" +msgstr "La longitud no puede ser menor a %s" + +#. module: report_qweb_parameter +#: code:addons/report_qweb_parameter/models/ir_qweb.py:19 +#, python-format +msgid "Length cannot be more than %s" +msgstr "La longitud no puede ser mayor a %s" + +#. module: report_qweb_parameter +#: model:ir.model,name:report_qweb_parameter.model_ir_qweb +msgid "Qweb" +msgstr "Qweb" diff --git a/report_qweb_parameter/models/ir_qweb.py b/report_qweb_parameter/models/ir_qweb.py index 5d110acf..51e9dfc3 100644 --- a/report_qweb_parameter/models/ir_qweb.py +++ b/report_qweb_parameter/models/ir_qweb.py @@ -30,9 +30,9 @@ class IrQWeb(models.AbstractModel): + ")" ) if "t-length" in el.attrib: - length = el.attrib.pop("t-length") - el.attrib["t-esc"] = "(" + el.attrib["t-esc"] + ")[:" + length + "]" - return super(IrQWeb, self)._compile_directive_esc(el, options) + tlength = el.attrib.pop("t-length") + el.attrib["t-esc"] = "(" + el.attrib["t-esc"] + ")[:" + tlength + "]" + return super()._compile_directive_esc(el, options) def _compile_directive_raw(self, el, options): min_value = el.attrib.pop("t-minlength", False) @@ -48,6 +48,6 @@ class IrQWeb(models.AbstractModel): + ")" ) if "t-length" in el.attrib: - length = el.attrib.pop("t-length") - el.attrib["t-raw"] = el.attrib["t-raw"] + "[:" + length + "]" - return super(IrQWeb, self)._compile_directive_raw(el, options) + tlength = el.attrib.pop("t-length") + el.attrib["t-raw"] = el.attrib["t-raw"] + "[:" + tlength + "]" + return super()._compile_directive_raw(el, options) diff --git a/report_qweb_parameter/readme/CONTRIBUTORS.rst b/report_qweb_parameter/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..f2b5eb2e --- /dev/null +++ b/report_qweb_parameter/readme/CONTRIBUTORS.rst @@ -0,0 +1,5 @@ +* Enric Tobella + +* `Tecnativa `_: + + * Carlos Roca diff --git a/report_qweb_parameter/readme/DESCRIPTION.rst b/report_qweb_parameter/readme/DESCRIPTION.rst new file mode 100644 index 00000000..a738afa6 --- /dev/null +++ b/report_qweb_parameter/readme/DESCRIPTION.rst @@ -0,0 +1,7 @@ +This module allows you to add new parameters on QWeb reports. +Currently, we have defined a field maximum on a report and a validation of +maximal and minimal size. +It is useful on xml reports in order to validate length. +XML are sometimes XSD dependant and we must validate its format. +For example, in spanish facturae (http://www.facturae.gob.es/Paginas/Index.aspx), where +length and format must be validated in several fields in order to send an invoice. diff --git a/report_qweb_parameter/readme/USAGE.rst b/report_qweb_parameter/readme/USAGE.rst new file mode 100644 index 00000000..80469d00 --- /dev/null +++ b/report_qweb_parameter/readme/USAGE.rst @@ -0,0 +1,3 @@ +#. Add a t-length attribute on report templates fields that will truncate the field +#. Add a t-minlength attribute on report template fields that will check the min length +#. Add a t-maxlength attribute on report template fields that will check the max length diff --git a/report_qweb_parameter/static/description/index.html b/report_qweb_parameter/static/description/index.html new file mode 100644 index 00000000..31e2fa65 --- /dev/null +++ b/report_qweb_parameter/static/description/index.html @@ -0,0 +1,443 @@ + + + + + + +Report QWeb Parameter + + + +
+

Report QWeb Parameter

+ + +

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

+

This module allows you to add new parameters on QWeb reports. +Currently, we have defined a field maximum on a report and a validation of +maximal and minimal size. +It is useful on xml reports in order to validate length. +XML are sometimes XSD dependant and we must validate its format. +For example, in spanish facturae (http://www.facturae.gob.es/Paginas/Index.aspx), where +length and format must be validated in several fields in order to send an invoice.

+

Table of contents

+ +
+

Usage

+
    +
  1. Add a t-length attribute on report templates fields that will truncate the field
  2. +
  3. Add a t-minlength attribute on report template fields that will check the min length
  4. +
  5. Add a t-maxlength attribute on report template fields that will check the max length
  6. +
+
+
+

Bug Tracker

+

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

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Creu Blanca
  • +
  • Tecnativa
  • +
+
+
+

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.

+
+
+
+ +