OCA reporting engine fork for dev and update.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

181 lines
7.7 KiB

  1. ==========================================
  2. Py3o Report Engine - Fusion server support
  3. ==========================================
  4. .. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  5. !! This file is generated by oca-gen-addon-readme !!
  6. !! changes will be overwritten. !!
  7. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  8. .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
  9. :target: https://odoo-community.org/page/development-status
  10. :alt: Beta
  11. .. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
  12. :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
  13. :alt: License: AGPL-3
  14. .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github
  15. :target: https://github.com/OCA/reporting-engine/tree/12.0/report_py3o_fusion_server
  16. :alt: OCA/reporting-engine
  17. .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
  18. :target: https://translation.odoo-community.org/projects/reporting-engine-12-0/reporting-engine-12-0-report_py3o_fusion_server
  19. :alt: Translate me on Weblate
  20. .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
  21. :target: https://runbot.odoo-community.org/runbot/143/12.0
  22. :alt: Try me on Runbot
  23. |badge1| |badge2| |badge3| |badge4| |badge5|
  24. 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:
  25. * much better performances (Libreoffice runs permanently in the background, no need to spawn a new Libreoffice instance upon every document conversion).
  26. * ability to configure PDF export options in Odoo. This brings many new possibilities such as the ability to generate:
  27. * PDF forms
  28. * PDF/A documents (required by some electronic invoicing standards such as `Factur-X <http://fnfe-mpe.org/factur-x/factur-x_en/>`_)
  29. * watermarked PDF documents
  30. * password-protected PDF documents
  31. **Table of contents**
  32. .. contents::
  33. :local:
  34. Installation
  35. ============
  36. Install several additional components and Python libs:
  37. * `Py3o Fusion server <https://bitbucket.org/faide/py3o.fusion>`_,
  38. * `Py3o render server <https://bitbucket.org/faide/py3o.renderserver>`_,
  39. * a Java Runtime Environment (JRE), which can be OpenJDK,
  40. * Libreoffice started in the background in headless mode,
  41. * the Java driver for Libreoffice (Juno).
  42. 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.
  43. 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.
  44. Installation of Libreoffice, JRE and required Java libs on Debian/Ubuntu:
  45. .. code::
  46. sudo apt-get install default-jre ure libgoogle-gson-java libreoffice-java-common libreoffice-writer
  47. 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:
  48. .. code::
  49. sudo apt-get install fonts-symbola
  50. Installation of py3o.fusion:
  51. .. code::
  52. pip3 install py3o.fusion
  53. pip3 install service-identity
  54. Installation of py3o.renderserver:
  55. .. code::
  56. pip3 install py3o.renderserver
  57. At the end, with the dependencies, you should have the following py3o python libs:
  58. .. code::
  59. % pip3 freeze | grep py3o
  60. py3o.formats==0.3
  61. py3o.fusion==0.8.9
  62. py3o.renderclient==0.3
  63. py3o.renderers.juno==0.8.1
  64. py3o.renderserver==0.5.2
  65. py3o.template==0.10.0
  66. py3o.types==0.1.1
  67. Start the Py3o Fusion server:
  68. .. code::
  69. start-py3o-fusion --debug -s localhost -i localhost
  70. Start the Py3o render server:
  71. .. code::
  72. 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
  73. On the output of the Py3o render server, the first line looks like:
  74. .. code::
  75. 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
  76. 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.
  77. 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.*.
  78. 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:
  79. .. code::
  80. sudo apt-get install msttcorefonts
  81. Configuration
  82. =============
  83. To configure the PDF export options:
  84. 1. Go to the menu *Settings > Technical > Reporting > Py3o > Py3o PDF Export Options* and create a PDF export options profile.
  85. #. 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*).
  86. Known issues / Roadmap
  87. ======================
  88. * Add support for PDF signatures (possible, but no easy because the signature certificate is a very particular PDF export option)
  89. Bug Tracker
  90. ===========
  91. Bugs are tracked on `GitHub Issues <https://github.com/OCA/reporting-engine/issues>`_.
  92. In case of trouble, please check there if your issue has already been reported.
  93. If you spotted it first, help us smashing it by providing a detailed and welcomed
  94. `feedback <https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_py3o_fusion_server%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
  95. Do not contact contributors directly about support or help with technical issues.
  96. Credits
  97. =======
  98. Authors
  99. ~~~~~~~
  100. * XCG Consulting
  101. * ACSONE SA/NV
  102. Contributors
  103. ~~~~~~~~~~~~
  104. * Florent Aide (`XCG Consulting <http://odoo.consulting/>`_)
  105. * Laurent Mignon <laurent.mignon@acsone.eu>,
  106. * Alexis de Lattre <alexis.delattre@akretion.com>,
  107. * Guewen Baconnier <guewen.baconnier@camptocamp.com>
  108. * Omar Castiñeira <omar@comunitea.com>
  109. * Holger Brunn <hbrunn@therp.nl>
  110. Maintainers
  111. ~~~~~~~~~~~
  112. This module is maintained by the OCA.
  113. .. image:: https://odoo-community.org/logo.png
  114. :alt: Odoo Community Association
  115. :target: https://odoo-community.org
  116. OCA, or the Odoo Community Association, is a nonprofit organization whose
  117. mission is to support the collaborative development of Odoo features and
  118. promote its widespread use.
  119. This module is part of the `OCA/reporting-engine <https://github.com/OCA/reporting-engine/tree/12.0/report_py3o_fusion_server>`_ project on GitHub.
  120. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.