From 37d1f1014b8d6630bcec780028175b0d9d915d1f Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Wed, 31 Jul 2019 06:50:18 +0000 Subject: [PATCH] [UPD] README.rst --- bi_sql_editor/static/description/index.html | 2 +- report_py3o/README.rst | 101 +-- report_py3o/static/description/index.html | 585 ++++++++++++++++++ report_py3o_fusion_server/README.rst | 97 ++- .../static/description/index.html | 511 +++++++++++++++ .../static/description/index.html | 2 +- .../static/description/index.html | 2 +- report_xlsx/static/description/index.html | 2 +- .../static/description/index.html | 2 +- report_xml/static/description/index.html | 2 +- 10 files changed, 1231 insertions(+), 75 deletions(-) create mode 100644 report_py3o/static/description/index.html create mode 100644 report_py3o_fusion_server/static/description/index.html diff --git a/bi_sql_editor/static/description/index.html b/bi_sql_editor/static/description/index.html index ea718d39..ce62a0e8 100644 --- a/bi_sql_editor/static/description/index.html +++ b/bi_sql_editor/static/description/index.html @@ -3,7 +3,7 @@ - + BI SQL Editor + + +
+

Py3o Report Engine

+ + +

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

+

The py3o reporting engine is a reporting engine for Odoo based on Libreoffice:

+ +

The key advantages of a Libreoffice based reporting engine are:

+ +

This module report_py3o is the base module for the Py3o reporting engine. If used alone, it will spawn a libreoffice process for each ODT to PDF (or ODT to DOCX, ..) document conversion. This is slow and can become a problem if you have a lot of reports to convert from ODT to another format. In this case, you should consider the additionnal module report_py3o_fusion_server which is designed to work with a libreoffice daemon. With report_py3o_fusion_server, the technical environnement is more complex to setup because you have to install additionnal software components and run 2 daemons, but you have much better performances and you can configure the libreoffice PDF export options in Odoo (allows to generate PDF forms, PDF/A documents, password-protected PDFs, watermarked PDFs, etc.).

+

This reporting engine is an alternative to Aeroo: these two reporting engines have similar features but their implementation is entirely different. You cannot use aeroo templates as drop in replacement though, you’ll have to change a few details.

+

Table of contents

+ +
+

Installation

+

Install the required python libs:

+
+pip install py3o.template
+pip install py3o.formats
+
+

To allow the conversion of ODT or ODS reports to other formats (PDF, DOC, DOCX, etc.), install libreoffice:

+
+apt-get --no-install-recommends install libreoffice
+
+
+
+

Configuration

+

For example, to replace the native invoice report by a custom py3o report, add the following XML file in your custom module:

+
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+
+<record id="account.account_invoices" model="ir.actions.report">
+    <field name="report_type">py3o</field>
+    <field name="py3o_filetype">odt</field>
+    <field name="module">my_custom_module_base</field>
+    <field name="py3o_template_fallback">report/account_invoice.odt</field>
+</record>
+
+</odoo>
+
+

where my_custom_module_base is the name of the custom Odoo module. In this example, the invoice ODT file is located in my_custom_module_base/report/account_invoice.odt.

+

It’s also possible to reference a template located in a trusted path of your +Odoo server. In this case you must let the module entry empty and specify +the path to the template as py3o_template_fallback.

+
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+
+<record id="account.account_invoices" model="ir.actions.report">
+    <field name="report_type">py3o</field>
+    <field name="py3o_filetype">odt</field>
+    <field name="py3o_template_fallback">/odoo/templates/py3o/report/account_invoice.odt</field>
+</record>
+
+</odoo>
+
+

Moreover, you must also modify the Odoo server configuration file to declare +the allowed root directory for your py3o templates. Only templates located +into this directory can be loaded by py3o report.

+
+[options]
+...
+
+[report_py3o]
+root_tmpl_path=/odoo/templates/py3o
+
+

If you want an invoice in PDF format instead of ODT format, the XML file should look like:

+
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+
+<record id="account.account_invoices" model="ir.actions.report">
+    <field name="report_type">py3o</field>
+    <field name="py3o_filetype">pdf</field>
+    <field name="module">my_custom_module_base</field>
+    <field name="py3o_template_fallback">report/account_invoice.odt</field>
+</record>
+
+</odoo>
+
+

If you want to add a new py3o PDF report (and not replace a native report), the XML file should look like this:

+
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+
+<record id="partner_summary_report" model="ir.actions.report">
+    <field name="name">Partner Summary</field>
+    <field name="model">res.partner</field>
+    <field name="report_name">res.partner.summary</field>
+    <field name="report_type">py3o</field>
+    <field name="py3o_filetype">pdf</field>
+    <field name="module">my_custom_module_base</field>
+    <field name="py3o_template_fallback">report/partner_summary.odt</field>
+    <!-- Add entry in "Print" drop-down list -->
+    <field name="binding_type">report</field>
+    <field name="binding_model_id" ref="base.model_res_partner"/>
+</record>
+
+</odoo>
+
+
+

Configuration parameters

+
+
py3o.conversion_command
+
The command to be used to run the conversion, libreoffice by default. If you change this, whatever you set here must accept the parameters --headless --convert-to $ext $file and put the resulting file into $file’s directory with extension $ext. The command will be started in $file’s directory.
+
+
+
+
+

Usage

+

The templating language is extensively documented, the records are exposed in libreoffice as objects, on which you can also call functions.

+
+

Available functions and objects

+
+
user
+
Browse record of current user
+
lang
+
The user’s company’s language as string (ISO code)
+
b64decode
+
base64.b64decode
+
format_multiline_value(string)
+
Generate the ODF equivalent of <br/> and &nbsp; for multiline fields (ODF is XML internally, so those would be skipped otherwise)
+
html_sanitize(string)
+
Sanitize HTML string
+
time
+
Python’s time module
+
display_address(partner)
+
Return a formatted string of the partner’s address
+
o_format_lang(value, lang_code=False, digits=None, grouping=True, monetary=False, dp=False, currency_obj=False, no_break_space=True)
+
Return a formatted numeric or monetary value according to the context language and timezone
+
o_format_date(value, lang_code=False, date_format=False)
+
Return a formatted date or time value according to the context language and timezone
+
+
+
+

Sample report templates

+

Sample py3o report templates for the main Odoo native reports (invoice, sale order, purchase order, picking, etc.) are available on the Github project odoo-py3o-report-templates.

+
+
+
+

Known issues / Roadmap

+
    +
  • generate barcode ?
  • +
  • add more detailed example in demo file to showcase features
  • +
  • add migration guide aeroo -> py3o
  • +
+
+
+

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

+
    +
  • XCG Consulting
  • +
  • ACSONE SA/NV
  • +
+
+
+

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_py3o_fusion_server/README.rst b/report_py3o_fusion_server/README.rst index 7e3d9e8a..ae6c1ee3 100644 --- a/report_py3o_fusion_server/README.rst +++ b/report_py3o_fusion_server/README.rst @@ -1,21 +1,45 @@ -.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html - :alt: License: AGPL-3 - ========================================== Py3o Report Engine - Fusion server support ========================================== +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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/12.0/report_py3o_fusion_server + :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-12-0/reporting-engine-12-0-report_py3o_fusion_server + :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/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + This module was written to let a py3o fusion server handle format conversion instead of local libreoffice. If you install this module above the *report_py3o* module, you will have to deploy additionnal software components and run 3 daemons (libreoffice, py3o.fusion and py3o.renderserver). This additionnal complexiy comes with several advantages: * much better performances (Libreoffice runs permanently in the background, no need to spawn a new Libreoffice instance upon every document conversion). * ability to configure PDF export options in Odoo. This brings many new possibilities such as the ability to generate: * PDF forms - * PDF/A documents (required by some electronic invoicing standards such as `Factur-X `_) + * PDF/A documents (required by some electronic invoicing standards such as `Factur-X `_) * watermarked PDF documents * password-protected PDF documents +**Table of contents** + +.. contents:: + :local: + Installation ============ @@ -29,7 +53,7 @@ Install several additional components and Python libs: It is also possible to use the Python driver for Libreoffice (PyUNO), but it is recommended to use the Java driver because it is more stable. -The installation procedure below uses the Java driver. It has been successfully tested on Ubuntu 16.04 LTS ; if you use another OS, you may have to change a few details. +The installation procedure below uses the Java driver. It has been successfully tested on Ubuntu 18.04 LTS ; if you use another OS, you may have to change a few details. Installation of Libreoffice, JRE and required Java libs on Debian/Ubuntu: @@ -47,45 +71,45 @@ Installation of py3o.fusion: .. code:: - pip install py3o.fusion - pip install service-identity + pip3 install py3o.fusion + pip3 install service-identity Installation of py3o.renderserver: .. code:: - pip install py3o.renderserver + pip3 install py3o.renderserver At the end, with the dependencies, you should have the following py3o python libs: .. code:: - % pip freeze | grep py3o + % pip3 freeze | grep py3o py3o.formats==0.3 - py3o.fusion==0.8.8 - py3o.renderclient==0.2 - py3o.renderers.juno==0.8 - py3o.renderserver==0.5.1 - py3o.template==0.9.12 + py3o.fusion==0.8.9 + py3o.renderclient==0.3 + py3o.renderers.juno==0.8.1 + py3o.renderserver==0.5.2 + py3o.template==0.10.0 py3o.types==0.1.1 Start the Py3o Fusion server: .. code:: - start-py3o-fusion --debug -s localhost + start-py3o-fusion --debug -s localhost -i localhost Start the Py3o render server: .. code:: - start-py3o-renderserver --java=/usr/lib/jvm/default-java/jre/lib/amd64/server/libjvm.so --ure=/usr/share --office=/usr/lib/libreoffice --driver=juno --sofficeport=8997 + start-py3o-renderserver --java=/usr/lib/jvm/default-java/lib/server/libjvm.so --ure=/usr/share --office=/usr/lib/libreoffice --driver=juno --sofficeport=8997 -i localhost On the output of the Py3o render server, the first line looks like: .. code:: - DEBUG:root:Starting JVM: /usr/lib/jvm/default-java/jre/lib/amd64/server/libjvm.so with options: -Djava.class.path=/usr/local/lib/python2.7/dist-packages/py3o/renderers/juno/py3oconverter.jar:/usr/share/java/juh.jar:/usr/share/java/jurt.jar:/usr/share/java/ridl.jar:/usr/share/java/unoloader.jar:/usr/share/java/java_uno.jar:/usr/lib/libreoffice/program/classes/unoil.jar -Xmx150M + DEBUG:root:Starting JVM: /usr/lib/jvm/default-java/lib/server/libjvm.so with options: -Djava.class.path=/usr/local/lib/python2.7/dist-packages/py3o/renderers/juno/py3oconverter.jar:/usr/share/java/juh.jar:/usr/share/java/jurt.jar:/usr/share/java/ridl.jar:/usr/share/java/unoloader.jar:/usr/share/java/java_uno.jar:/usr/lib/libreoffice/program/classes/unoil.jar -Xmx150M After **-Djava.class.path**, there is a list of Java libs with *.jar* extension ; check that each JAR file is really present on your filesystem. If one of the jar files is present in another directory, create a symlink that points to the real location of the file. If all the jar files are present on another directory, adapt the *--ure=* argument on the command line of Py3o render server. @@ -97,6 +121,13 @@ If you want to produce valid PDF/A documents with this module, activating the co sudo apt-get install msttcorefonts +Configuration +============= + +To configure the PDF export options: + +1. Go to the menu *Settings > Technical > Reporting > Py3o > Py3o PDF Export Options* and create a PDF export options profile. +#. Set the PDF export options profile on the Py3o Server (menu *Settings > Technical > Reporting > Py3o > Py3o Servers*) or on a particular Py3o report with PDF output format (menu *Settings > Technical > Actions > Reports*). Known issues / Roadmap ====================== @@ -106,16 +137,24 @@ Known issues / Roadmap Bug Tracker =========== -Bugs are tracked on `GitHub Issues -`_. In case of trouble, please -check there if your issue has already been reported. If you spotted it first, -help us smashing it by providing a detailed and welcomed feedback. +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. Credits ======= +Authors +~~~~~~~ + +* XCG Consulting +* ACSONE SA/NV + Contributors ------------- +~~~~~~~~~~~~ * Florent Aide (`XCG Consulting `_) * Laurent Mignon , @@ -124,19 +163,19 @@ Contributors * Omar Castiñeira * Holger Brunn -Do not contact contributors directly about help with questions or problems concerning this addon, but use the `community mailing list `_ or the `appropriate specialized mailinglist `_ for help, and the bug tracker linked in `Bug Tracker`_ above for technical issues. +Maintainers +~~~~~~~~~~~ -Maintainer ----------- +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_py3o_fusion_server/static/description/index.html b/report_py3o_fusion_server/static/description/index.html new file mode 100644 index 00000000..18f95732 --- /dev/null +++ b/report_py3o_fusion_server/static/description/index.html @@ -0,0 +1,511 @@ + + + + + + +Py3o Report Engine - Fusion server support + + + +
+

Py3o Report Engine - Fusion server support

+ + +

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

+

This module was written to let a py3o fusion server handle format conversion instead of local libreoffice. If you install this module above the report_py3o module, you will have to deploy additionnal software components and run 3 daemons (libreoffice, py3o.fusion and py3o.renderserver). This additionnal complexiy comes with several advantages:

+
    +
  • much better performances (Libreoffice runs permanently in the background, no need to spawn a new Libreoffice instance upon every document conversion).
  • +
  • ability to configure PDF export options in Odoo. This brings many new possibilities such as the ability to generate:
      +
    • PDF forms
    • +
    • PDF/A documents (required by some electronic invoicing standards such as Factur-X)
    • +
    • watermarked PDF documents
    • +
    • password-protected PDF documents
    • +
    +
  • +
+

Table of contents

+ +
+

Installation

+

Install several additional components and Python libs:

+
    +
  • Py3o Fusion server,
  • +
  • Py3o render server,
  • +
  • a Java Runtime Environment (JRE), which can be OpenJDK,
  • +
  • Libreoffice started in the background in headless mode,
  • +
  • the Java driver for Libreoffice (Juno).
  • +
+

It is also possible to use the Python driver for Libreoffice (PyUNO), but it is recommended to use the Java driver because it is more stable.

+

The installation procedure below uses the Java driver. It has been successfully tested on Ubuntu 18.04 LTS ; if you use another OS, you may have to change a few details.

+

Installation of Libreoffice, JRE and required Java libs on Debian/Ubuntu:

+
+sudo apt-get install default-jre ure libgoogle-gson-java libreoffice-java-common libreoffice-writer
+
+

You may have to install additionnal fonts. For example, to have the special unicode symbols for phone/fax/email in the PDF reports generated by Py3o, you should install the following package:

+
+sudo apt-get install fonts-symbola
+
+

Installation of py3o.fusion:

+
+pip3 install py3o.fusion
+pip3 install service-identity
+
+

Installation of py3o.renderserver:

+
+pip3 install py3o.renderserver
+
+

At the end, with the dependencies, you should have the following py3o python libs:

+
+% pip3 freeze | grep py3o
+py3o.formats==0.3
+py3o.fusion==0.8.9
+py3o.renderclient==0.3
+py3o.renderers.juno==0.8.1
+py3o.renderserver==0.5.2
+py3o.template==0.10.0
+py3o.types==0.1.1
+
+

Start the Py3o Fusion server:

+
+start-py3o-fusion --debug -s localhost -i localhost
+
+

Start the Py3o render server:

+
+start-py3o-renderserver --java=/usr/lib/jvm/default-java/lib/server/libjvm.so --ure=/usr/share --office=/usr/lib/libreoffice --driver=juno --sofficeport=8997 -i localhost
+
+

On the output of the Py3o render server, the first line looks like:

+
+DEBUG:root:Starting JVM: /usr/lib/jvm/default-java/lib/server/libjvm.so with options: -Djava.class.path=/usr/local/lib/python2.7/dist-packages/py3o/renderers/juno/py3oconverter.jar:/usr/share/java/juh.jar:/usr/share/java/jurt.jar:/usr/share/java/ridl.jar:/usr/share/java/unoloader.jar:/usr/share/java/java_uno.jar:/usr/lib/libreoffice/program/classes/unoil.jar -Xmx150M
+
+

After -Djava.class.path, there is a list of Java libs with .jar extension ; check that each JAR file is really present on your filesystem. If one of the jar files is present in another directory, create a symlink that points to the real location of the file. If all the jar files are present on another directory, adapt the –ure= argument on the command line of Py3o render server.

+

To check that the Py3o Fusion server is running fine, visit the URL http://<IP_address>:8765/form. On this web page, under the section Target format, make sure that you have a line This server currently supports these formats: ods, odt, docx, doc, html, docbook, pdf, xls..

+

If you want to produce valid PDF/A documents with this module, activating the corresponding option in the PDF Export Options may not be enough, you also have to make sure that all the fonts used in the document template are installed on the Odoo server, so that they can be embedded in the PDF/A document. For example, if your document template uses the Arial font, you should install that font on your Odoo server:

+
+sudo apt-get install msttcorefonts
+
+
+
+

Configuration

+

To configure the PDF export options:

+
    +
  1. Go to the menu Settings > Technical > Reporting > Py3o > Py3o PDF Export Options and create a PDF export options profile.
  2. +
  3. Set the PDF export options profile on the Py3o Server (menu Settings > Technical > Reporting > Py3o > Py3o Servers) or on a particular Py3o report with PDF output format (menu Settings > Technical > Actions > Reports).
  4. +
+
+
+

Known issues / Roadmap

+
    +
  • Add support for PDF signatures (possible, but no easy because the signature certificate is a very particular PDF export option)
  • +
+
+
+

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

+
    +
  • XCG Consulting
  • +
  • ACSONE SA/NV
  • +
+
+
+

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_qweb_signer/static/description/index.html b/report_qweb_signer/static/description/index.html index c47bafad..3f12c6e4 100644 --- a/report_qweb_signer/static/description/index.html +++ b/report_qweb_signer/static/description/index.html @@ -3,7 +3,7 @@ - + Qweb PDF reports signer