Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
f768863
Init - Print the odt template without modification (empty values)
houzefa-abba Oct 24, 2013
b6a148f
Overridable function to customize the values sent to the py3o renderer
houzefa-abba Oct 24, 2013
1bf8c30
Update .hgignore
houzefa-abba Oct 25, 2013
379f3d4
Provide a lang object
houzefa-abba Oct 28, 2013
b23860e
py3o.template now knows about the pyjon req
houzefa-abba Oct 28, 2013
e9c4d7c
Customization of report templates with a field to download/upload
houzefa-abba Oct 28, 2013
6df4a84
Hide the function field when the binary field is filled
houzefa-abba Oct 28, 2013
1a84a03
Add a function to format dates
houzefa-abba Oct 29, 2013
a55a474
Version 1.0
houzefa-abba Nov 29, 2013
1337a67
Added tag TAG_1.0 for changeset ae59b92cb6bd
houzefa-abba Nov 29, 2013
2b26a5f
Declare the dependency on py3o.template - fix #3
houzefa-abba Dec 16, 2013
c5d6926
bumped version to 1.1 (stable)
Feb 5, 2014
e3dcf11
Added tag TAG_1.1 for changeset 392758bf61eb
Feb 5, 2014
09542c7
bumped version to 1.1.1 (dev)
Feb 5, 2014
483dbe7
Now we call fusion server just to convert reports into the right format
anael-lorimier Oct 14, 2014
0dff6d2
1.2
anael-lorimier Oct 14, 2014
1ff6d8e
Added tag TAG_1.2 for changeset b6c64ac6e399
anael-lorimier Oct 14, 2014
81e37f9
Remove deps
anael-lorimier Oct 14, 2014
872d3d3
1.2.1
anael-lorimier Oct 14, 2014
54d831e
Added tag TAG_1.2.1 for changeset cd840bda3fa0
anael-lorimier Oct 14, 2014
487ed70
Add missing files
anael-lorimier Oct 14, 2014
b04cef9
1.2.2
anael-lorimier Oct 15, 2014
b62f55b
Added tag TAG_1.2.2 for changeset 092018f8f6ca
anael-lorimier Oct 15, 2014
313e64a
move py3o menu
anael-lorimier Oct 15, 2014
a8add89
1.2.3
anael-lorimier Oct 15, 2014
7ef42df
Added tag TAG_1.2.3 for changeset 2203f0ccc2e2
anael-lorimier Oct 15, 2014
9163a2a
Add skipfusion flag to post
anael-lorimier Oct 15, 2014
75e7cb8
1.2.4
anael-lorimier Oct 15, 2014
7544423
Added tag TAG_1.2.4 for changeset d6fa2a1477bc
anael-lorimier Oct 15, 2014
246b6ab
Add security rules
anael-lorimier Oct 15, 2014
fb5b0c6
1.2.5
anael-lorimier Oct 15, 2014
174203a
Added tag TAG_1.2.5 for changeset 067b603cc82e
anael-lorimier Oct 15, 2014
5bd73ea
Call new methods from py3o.template to easily jsonify our datastruct
anael-lorimier Nov 7, 2014
9d99f39
Remove useless stuff
anael-lorimier Nov 7, 2014
95a4f0f
1.3 production release
Dec 22, 2014
460ae07
Added tag TAG_1.3 for changeset f1771be362a2
Dec 22, 2014
30404a7
Version 1.3
houzefa-abba Dec 22, 2014
d4edd46
Added tag TAG_1.3 for changeset ce6b34e12517
houzefa-abba Dec 22, 2014
ca0f3cb
Merge the 1.2 branch
houzefa-abba Dec 22, 2014
e38bd9c
Version 1.3.1
houzefa-abba Dec 22, 2014
95f4ce9
Added tag TAG_1.3.1 for changeset a9d3f3747769
houzefa-abba Dec 22, 2014
07d8707
Update and Add License (AGPL) and (XCG)
Jan 15, 2015
ef92dfd
Add README
Jan 16, 2015
b54dd2b
Odoo 8 fixes
anael-lorimier Feb 18, 2015
c74ba0e
Development of Py3o Parser to reproduce the behaviour of WebKit Repor…
anael-lorimier Feb 23, 2015
59ab08e
Py3o update for odoo 8
anael-lorimier Feb 24, 2015
f7f01b9
Fix openerp.py xml order
anael-lorimier Apr 1, 2015
9cbc9b2
we depend on report
faide May 22, 2015
0da8532
Fix some pep8 and mistakes
anael-lorimier May 28, 2015
d85f5ed
Real instructions to allow odoo to find the py3o.template module
faide May 29, 2015
7ac7866
Just add the CSV to the data section
faide May 29, 2015
8afaac7
pep ftw
faide Jun 1, 2015
c99b682
Output format is MANDATORY... if you don't give it will fail horribly…
faide Jun 2, 2015
2c47a47
better docstring
faide Jun 2, 2015
ef01166
Adding a fallback system so that you own implementer module can defin…
faide Jun 2, 2015
f71cbbb
removed unused file
faide Jun 2, 2015
1dee923
Now support latest fusion server & better error reporting
faide Jun 3, 2015
214e25c
removed "required" constraint;
brmasson Jun 4, 2015
6439ca8
2.0b1
anael-lorimier Sep 1, 2015
87f8fac
Added tag TAG_2.0b1 for changeset 801e4bf837a2
anael-lorimier Sep 1, 2015
e30b1ba
Use the latest features of py3o.template with odoo8
anael-lorimier Nov 9, 2015
27155d2
TAG_2.0b2
anael-lorimier Nov 9, 2015
da9566c
Added tag TAG_2.0b2 for changeset 2e68df0df26d
anael-lorimier Nov 9, 2015
aacb84e
i18n
anael-lorimier Dec 1, 2015
2feb6ac
2.0
anael-lorimier Dec 1, 2015
7c63885
Added tag TAG_8.0.2.0 for changeset 77b8df614816
anael-lorimier Dec 1, 2015
4f2776c
8.0.2.1
szekawong Feb 9, 2016
1d33221
Étiquette TAG_8.0.2.1 ajoutée à la révision 65b3c62a20f1
szekawong Feb 9, 2016
49defab
Restore direct rendering for native ODT output formats
gavrelj Mar 9, 2016
ab49206
Add search view for py3o_template
gavrelj Mar 9, 2016
1826aa2
Only use direct rendering as a fallback if no py3o server is defined
gavrelj Mar 9, 2016
7e9a765
Can set Py3o servers as inactive
gavrelj Mar 9, 2016
3f04c13
Fix raise error
sbidoul Mar 14, 2016
50cd4c6
Fix py3o_template_fallback help string
gavrelj Apr 8, 2016
c766924
Fix py3o_template_fallback help string
gavrelj Apr 8, 2016
d60fb75
Add oe_json_serializer in external_dependencies.
szekawong Sep 14, 2016
5089921
Replace get_user_variables (=deprecated) with get_all_user_python_exp…
szekawong Sep 16, 2016
3a73f24
Remove dependency to oe_json_serializer due to packaging issues
brmasson Sep 19, 2016
c1479c6
Move to report_py3o after import from HG
lmignon Oct 3, 2016
9c9fe7e
Merge branch 'report_py3o' into HEAD
lmignon Oct 3, 2016
0b49458
remove hg files
lmignon Oct 3, 2016
b6383bb
Add setup
lmignon Oct 3, 2016
4318e41
[FIX] View inheritance may not use attribute 'string' as a selector.
lmignon Oct 3, 2016
6dae7de
[IMP] New API + Short Hearder
lmignon Oct 4, 2016
5dc8bb3
[FIX] Add depndency on py3o.template
lmignon Oct 4, 2016
6e090ca
Merge pull request #1 from acsone/9.0-import_report_py3o
faide Oct 4, 2016
099fe5e
Remove unicode string
lmignon Oct 4, 2016
439a494
[IMP] Add the possiblity to get the template from an absolute path on…
lmignon Oct 4, 2016
769f23f
Merge pull request #2 from acsone/9.0-import_report_py3o
faide Oct 4, 2016
cbc1416
[IMP] Allow user to use local fusion
lmignon Oct 4, 2016
e3cd35a
Merge pull request #3 from acsone/9.0-import_report_py3o
faide Oct 4, 2016
4789870
Add dependency on py3.formats for travis
lmignon Oct 4, 2016
606782f
Merge pull request #4 from acsone/9.0-import_report_py3o
faide Oct 4, 2016
a21ac81
Add a simple way to extend the parser context
lmignon Oct 4, 2016
20c9242
Remove ACL on removed model
lmignon Oct 4, 2016
fbf1940
Improve filetype selection name
lmignon Oct 4, 2016
f6293ea
Fix native flag
lmignon Oct 4, 2016
36c546e
Merge pull request #5 from acsone/9.0-import_report_py3o
faide Oct 4, 2016
3c12e2c
fixed missing comma in model definition
faide Oct 4, 2016
f7a0bf0
Add simple tests and fix call to fusion server
lmignon Oct 4, 2016
e523ca8
Merge pull request #7 from acsone/9.0-import_report_py3o
faide Oct 4, 2016
e97cfb7
Fix skip fusion on server when the fusion is local
lmignon Oct 4, 2016
aa91d03
Improve tests
lmignon Oct 4, 2016
31f9301
Replace openerp element by odoo
lmignon Oct 4, 2016
8b9a824
Merge pull request #8 from acsone/9.0-import_report_py3o
faide Oct 4, 2016
83f88aa
Small usability improvements
alexis-via Oct 4, 2016
2fbbdc9
Take into accounts most remarks of @lasley
alexis-via Oct 5, 2016
c41dd46
Merge pull request #9 from akretion/py3o-usability
faide Oct 5, 2016
3a3b581
Replace plain SQL by orm
lmignon Oct 6, 2016
3043455
rename module ir_report to ir_actions_report_xml
lmignon Oct 6, 2016
de2973c
Add more tests and fixes issues found by tests
lmignon Oct 6, 2016
20940bc
Merge pull request #10 from acsone/9.0-import_report_py3o
faide Oct 6, 2016
506ec71
[FIX] Check constrains only if report_type == 'py3o'
lmignon Oct 12, 2016
80def28
Merge pull request #11 from acsone/9.0-import_report_py3o
faide Oct 13, 2016
60ad812
report_py3o: full installation procedure in README
alexis-via Oct 14, 2016
f795b1f
Port report_py3o to Odoo v10
alexis-via Oct 14, 2016
f69c389
Update version numbers
alexis-via Oct 14, 2016
74b4aa4
PEP8 fix
alexis-via Oct 14, 2016
cd28829
Update README
alexis-via Nov 4, 2016
e544a8c
[FIX] setup.py for odoo10
Dec 13, 2016
b702d15
FIX double dot in filename
alexis-via Dec 19, 2016
3d3af33
Add access to report_xml object in report
alexis-via Dec 19, 2016
613894c
FIX Adapt test suite to my recent commit to avoid double dot on filen…
alexis-via Dec 20, 2016
9f2ca7d
Merge pull request #1 from acsone/10-port-py3o-fix_setup-jne
Dec 26, 2016
6c74f0e
[IMP] Escape 'False' when rendering value
lmignon Nov 16, 2016
ac98e1b
[IMP] Replace old style parser by TransientModel
lmignon Dec 17, 2016
efcbd1d
[FIX] imports
Dec 22, 2016
f592b75
[IMP] Minimizes memory consumption
lmignon Dec 23, 2016
7bda0cb
* travis.yml
Jan 9, 2017
d968ecb
Update and improve README instructions to setup py3o
alexis-via Jan 25, 2017
5ac6710
Merge branch '10-port-py3o' of github.com:akretion/reporting-engine i…
alexis-via Jan 25, 2017
4048c0b
[IMP] Allow to override/extend the way we get the fallback template
lmignon Jan 25, 2017
4aab7f9
Merge pull request #2 from acsone/10.0-refactor_py3o-jne
Feb 14, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ python:

env:
global:
- VERSION="9.0" TESTS="0" LINT_CHECK="0" TRANSIFEX="0"
- VERSION="10.0" TESTS="0" LINT_CHECK="0" TRANSIFEX="0"
- TRANSIFEX_USER='transbot@odoo-community.org'
- secure: NUsXwVrMntcqge1ozKW+DSkP7dq+Rla6JVvFF2c89/g+zJaIqQRi8EQBLoqNwCdMk+rjpQeZt/JPELjH+EzPcmGddhDxOgVB3nUT9LvFXGCHF+NjmHXqyba4tuc7BnpG1WDD+rSlxVCt1aIjNIhhaZ4ic0rCWpKNYu/yFTsmChc=
matrix:
Expand Down
661 changes: 661 additions & 0 deletions report_py3o/LICENSE

Large diffs are not rendered by default.

225 changes: 225 additions & 0 deletions report_py3o/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,225 @@
.. 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

===========
Report Py3o
===========

The py3o reporting engine is a reporting engine for Odoo based on `Libreoffice <http://www.libreoffice.org/>`_:

* the report is created with Libreoffice (ODT or ODS),
* the report is stored on the server in OpenDocument format (.odt or .ods file)
* the report is sent to the user in OpenDocument format or in any output format supported by Libreoffice (PDF, HTML, DOC, DOCX, Docbook, XLS, etc.)

The key advantages of a Libreoffice-based reporting engine are:

* no need to be a developper to create or modify a report: the report is created and modified with Libreoffice. So this reporting engine has a fully WYSIWYG report developpment tool!

* For a PDF report in A4/Letter format, it's easier to develop it with a tool such as Libreoffice that is designed to create A4/Letter documents than to develop it in HTML/CSS.

* If you want your users to be able to modify the document after its generation by Odoo, just configure the document with ODT output (or DOC or DOCX) and the user will be able to modify the document with Libreoffice (or Word) after its generation by Odoo.

* Easy development of spreadsheet reports in ODS format (XLS output possible).

This reporting engine is an alternative to `Aeroo <https://github.com/aeroo/aeroo_reports>`_: these 2 reporting engines have similar features but their codes are completely different.

Installation
============

You must install 2 additionnal python libs:

.. code::

pip install py3o.template
pip install py3o.formats

To allow the conversion of ODT or ODS reports to other formats (PDF, DOC, DOCX, etc.), you must install several additionnal components and Python libs:

* `Py3o Fusion server <https://bitbucket.org/faide/py3o.fusion>`_,
* `Py3o render server <https://bitbucket.org/faide/py3o.renderserver>`_,
* 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 16.04 LTS ; if you use another OS, you may have to change a few details.

Installation of py3o.fusion:

.. code::

pip install py3o.fusion
pip install service-identity

Installation of py3o.renderserver:

.. code::

pip install py3o.renderserver

Installation of Libreoffice and JRE on Debian/Ubuntu:

.. code::

sudo apt-get install default-jre ure 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:

.. code::

sudo apt-get install fonts-symbola

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

.. code::

% pip freeze | grep py3o
py3o.formats==0.3
py3o.fusion==0.8.6
py3o.renderclient==0.2
py3o.renderers.juno==0.8
py3o.renderserver==0.5.1
py3o.template==0.9.11
py3o.types==0.1.1

Start the Py3o Fusion server:

.. code::

start-py3o-fusion --debug -s 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

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

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.*.

Configuration
=============

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

.. code::

<?xml version="1.0" encoding="utf-8"?>
<odoo>

<record id="account.account_invoices" model="ir.actions.report.xml">
<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*.

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

.. code::

<?xml version="1.0" encoding="utf-8"?>
<odoo>

<record id="local_py3o_server" model="py3o.server">
<field name="url">http://localhost:8765/form</field>
</record>

<record id="account.account_invoices" model="ir.actions.report.xml">
<field name="report_type">py3o</field>
<field name="py3o_filetype">pdf</field>
<field name="py3o_server_id" ref="local_py3o_server"/>
<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:

.. code::

<?xml version="1.0" encoding="utf-8"?>
<odoo>

<record id="local_py3o_server" model="py3o.server">
<field name="url">http://localhost:8765/form</field>
</record>

<record id="partner_summary_report" model="ir.actions.report.xml">
<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="py3o_server_id" ref="local_py3o_server"/>
<field name="module">my_custom_module_base</field>
<field name="py3o_template_fallback">report/partner_summary.odt</field>
</record>

<!-- Add entry in "Print" drop-down list -->
<record id="button_partner_summary_report" model="ir.values">
<field name="key2">client_print_multi</field>
<field name="model">res.partner</field>
<field name="name">Partner Summary</field>
<field name="value" eval="'ir.actions.report.xml,%d'%partner_summary_report" />
</record>

</odoo>

Usage
=====

.. 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/10.0

Known issues / Roadmap
======================

* generate barcode ?

Bug Tracker
===========

Bugs are tracked on `GitHub Issues
<https://github.com/OCA/reporting-engine/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.

Credits
=======

Contributors
------------

* Florent Aide (`XCG Consulting <http://odoo.consulting/>`_)
* Laurent Mignon (Acsone)

Maintainer
----------

.. 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.
1 change: 1 addition & 0 deletions report_py3o/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
27 changes: 27 additions & 0 deletions report_py3o/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# -*- coding: utf-8 -*-
# Copyright 2013 XCG Consulting (http://odoo.consulting)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Py3o Report Engine',
'summary': 'Reporting engine based on Libreoffice (ODT -> ODT, '
'ODT -> PDF, ODT -> DOC, ODT -> DOCX, ODS -> ODS, etc.)',
'version': '10.0.1.0.0',
'category': 'Reporting',
'license': 'AGPL-3',
'author': 'XCG Consulting,Odoo Community Association (OCA)',
'website': 'http://odoo.consulting/',
'depends': ['report'],
'external_dependencies': {
'python': ['py3o.template',
'py3o.formats']
},
'data': [
'security/ir.model.access.csv',
'views/menu.xml',
'views/py3o_template.xml',
'views/py3o_server.xml',
'views/ir_report.xml',
'demo/report_py3o.xml',
],
'installable': True,
}
28 changes: 28 additions & 0 deletions report_py3o/demo/report_py3o.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2016 ACSONE SA/NV
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->

<odoo>

<record id="res_users_report_py3o" model="ir.actions.report.xml">
<field name="name">Py3o Demo Report</field>
<field name="type">ir.actions.report.xml</field>
<field name="model">res.users</field>
<field name="report_name">py3o_user_info</field>
<field name="report_type">py3o</field>
<field name="py3o_filetype">odt</field>
<field name="py3o_is_local_fusion" eval="1"/>
<field name="py3o_filetype">odt</field>
<field name="module">report_py3o</field>
<field name="py3o_template_fallback">demo/res_user.odt</field>
</record>

<record id="res_users_report_py3o_print_action" model="ir.values">
<field eval="'action'" name="key" />
<field eval="'client_print_multi'" name="key2" />
<field name="model">res.users</field>
<field name="name">Py3o Demo Report</field>
<field eval="'ir.actions.report.xml,'+str(res_users_report_py3o)" name="value" />
</record>

</odoo>
Binary file added report_py3o/demo/res_user.odt
Binary file not shown.
Loading