Commit Graph

66 Commits

Author SHA1 Message Date
OCA-git-bot
f0c3a80fdd Merge PR #921 into 16.0
Signed-off-by HviorForgeFlow
2024-10-22 18:07:34 +00:00
Thomas Binsfeld
6283f0d37c [IMP] report_py3o: use the standard file name behavior when zipping report files 2024-08-28 13:45:48 +02:00
Imbar Budiman
aebfc872e8 [FIX] report_py3o: change display_address() to _display_address() 2024-08-21 15:16:33 +07:00
Justine Doutreloux
758af54a57 [FIX] _py3o_parser_context: fix call to format_date in old_format_lang 2024-07-24 09:23:44 +02:00
fazledyn-or
1e86acae8b Reformatted using pre-commit
Signed-off-by: fazledyn-or <ataf@openrefactory.com>
2023-11-09 10:48:54 +06:00
fazledyn-or
494b7bae12 Replaced mktemp with mkstemp
Signed-off-by: fazledyn-or <ataf@openrefactory.com>
2023-11-08 18:19:48 +06:00
Alexis de Lattre
651813a647 [MIG] report_py3o to v16 2022-12-12 22:52:24 +01:00
Tran Thanh Phuc
aa228f0d89 [MIG] report_py3o: Migration to 15.0 2022-12-12 09:31:45 +01:00
Denis Leemann
70f8ba2f3a run pre-commit 2022-12-12 09:31:45 +01:00
Elmeri Niemelä
96a69faf88 [IMP] Remove except of IOError as its an alias to OSError in python3
Co-authored-by: Nils Hamerlinck <nilshamerlinck@users.noreply.github.com>
2022-12-12 09:31:45 +01:00
Elmeri Niemelä
d15d332a31 [IMP] Cleanup unnecessary imports
Co-authored-by: Nils Hamerlinck <nilshamerlinck@users.noreply.github.com>
2022-12-12 09:31:45 +01:00
Elmeri Niemelä
d588063723 [IMP] Workaround for genshi DeprecationWarning that makes runbot build red
Co-authored-by: Nils Hamerlinck <nilshamerlinck@users.noreply.github.com>
2022-12-12 09:31:45 +01:00
Elmeri Niemelä
038e536ad6 [IMP] Add ability to include properly formatted datetime field in a report displaying date and time 2022-12-12 09:31:45 +01:00
Elmeri Niemelä
c78902369d [MIG] Use safe_eval wrapped time module. Fix deprecation warnings.
Co-authored-by: Alexis de Lattre <alexis.delattre@akretion.com>
2022-12-12 09:31:45 +01:00
Elmeri Niemelä
f7286ba520 Update report_py3o/models/ir_actions_report.py
In v 14.0 time module is already in safe_eval https://github.com/odoo/odoo/blob/14.0/odoo/tools/safe_eval.py#L38

Co-authored-by: mourad-ehm <mourad.elhadj.mimoune@akretion.com>
2022-12-12 09:31:45 +01:00
Elmeri Niemelä
7f83800b04 [14.0][MIG] report_py3o: Migration to 14.0 2022-12-12 09:31:45 +01:00
sbejaoui
58ce5780ff [12.0][FIX] - report_py3o: run libreoffice in an isolated user installation
Bug when more than one conversion print is launched within the same libreoffice instance.

The standard behavior of libreoffice when a user open it while another instance is
running is to show a new window and throw an error if a new instance is forced within
the same user installation [see](https://bugs.documentfoundation.org/show_bug.cgi?id=37531).

This implies a bug in report_py3o module when we call libreoffice at the same time for
different documents.

To reproduce this bug:

**Case 1:**
1.  Simultaneously print two documents.

**Case 2:**
1.  Run print jobs using job_queue module
2.  Manually print another document

**Case 3:**
2.  Open libreoffice
3.  Print a py3o report

This PR creates a temporary user installation for each libreoffice conversion to bypass this limitation.
2022-12-12 09:31:45 +01:00
Russell Briggs
52d475fa21 Make sure value is always set for computed fields
(without these a CacheMiss error is thrown by odoo)
2022-12-12 09:31:45 +01:00
Laurent Mignon (ACSONE)
f3342f26a4 [MIG] report_py3o, report_py3o_fusion_server: Migration to 13.0 2022-12-12 09:31:45 +01:00
Laurent Mignon (ACSONE)
be6ff706a1 [IMP] report_py3o, report_py3o_fusion_server: black, isort 2022-12-12 09:31:45 +01:00
Laurent Mignon (ACSONE)
8b586a02de [FIX] report_py3o: Access to ir.config_parameter with sudo 2022-12-12 09:31:45 +01:00
Laurent Mignon (ACSONE)
1863c8db45 [IMP] py3o_report: Allow to specify the lang when calling o_format_lang
lang_code is already supported by o_format_date
2022-12-12 09:31:45 +01:00
Laurent Mignon (ACSONE)
1a5e6a1b1a [FIX] report_py3o: Add missing 'user' and 'lang' into the parser context 2022-12-12 09:31:45 +01:00
Laurent Mignon (ACSONE)
89b6a9d96b [IMP][FIX] py3o_report, py3o_report_fusion_server: Compute the availability of py3o report
Before this change it was not possible to install modules declaring py3o report into a non native format without specifying a Fusion server once the module py3o_report_fusion_server was installed. With theses changes, we now take care of the availability of the libreoffice runtime to display/log a warning message when the report is in a non native runtime.
2022-12-12 09:31:45 +01:00
Laurent Mignon (ACSONE)
4c5c8b3c57 [FIX] report_py3o: Add missing method _merge_pdf.
This method was previously provided by Odoo and is used to merge all the reports generated if the generation is called for more than one record
2022-12-12 09:31:45 +01:00
Laurent Mignon (ACSONE)
da64b691b0 [IMP] report_py3o: remove obsolete methods 2022-12-12 09:31:45 +01:00
Laurent Mignon (ACSONE)
e610057c6b [FIX] report_py3o: Use the right naming convention for the render method
To determine the method to use to render a recport according to its type, the generic method 'render' defined into ir.action.report check if a method name  is defined on the model. https://github.com/odoo/odoo/blob/12.0/odoo/addons/base/models/ir_actions_report.py#L734
Therefore, we must provide this method to be compliant with what's expected by Odoo.
This change will also allows the usage of py3o template with mail_template once https://github.com/odoo/odoo/pull/30013 will be merged
2022-12-12 09:31:45 +01:00
Gilles Meyomesse
64ce3fd0b8 [12.0][MIG] improvement py3o_report_extender 2022-12-12 09:31:45 +01:00
Laurent Mignon (ACSONE)
b220ba1d57 [MIG] report_py3o, report_py3o_fusion_server: Migration to 12.0 2022-12-12 09:31:45 +01:00
Holger Brunn
eacf2a648c [IMP] check for template data, not for the id 2022-12-12 09:31:45 +01:00
jesusVMayor
410df815d4 [FIX]report_py3o: Escape correctly html characters. 2022-12-12 09:31:45 +01:00
Holger Brunn
6f8ad2396d [FIX] fallback to libreoffice conversion when no server is configured
fixes #200
2022-12-12 09:31:45 +01:00
Holger Brunn
0b052039cb [RFR] split off the fusion server to its own module
use libreoffice for conversions in the base version. Fixes #179
2022-12-12 09:31:45 +01:00
Omar
ccadac7315 [FIX] report_py3o: Import new dependencies in try...except 2022-12-12 09:31:45 +01:00
Omar
9bc5a03826 [FIX] report_py3o: Removes api.one 2022-12-12 09:31:45 +01:00
omar7r
16dba5c7d3 [FIX] Deletes an unnecessary function call 2022-12-12 09:31:45 +01:00
Omar
7ed89d5c5a [IMP] report_py3o: Allows to interpret \n and \t in texts, cleans html tags too 2022-12-12 09:31:45 +01:00
Laurent Mignon
8eb9bfd56d [IMP] report_py3o: Take into account print_report_name
If a Printed Report Name is set on the action report, use it as
downloaded filename
refs #133
2022-12-12 09:31:45 +01:00
Laurent Mignon (ACSONE)
eab6c80ecc [FIX] report_py3o: must return the path to the report
refs #119
2022-12-12 09:31:45 +01:00
Alexis de Lattre
ec1a4030cb Add option py3o_multi_in_one for Py3o reports 2022-12-12 09:31:45 +01:00
Guewen Baconnier
f8b75456bd Pass option for escaping False values to server
Needs https://bitbucket.org/faide/py3o.fusion/pull-requests/1
2022-12-12 09:31:45 +01:00
Guewen Baconnier
b0a07ee9a6 Fix py3o freeze when using server fusion
The template file has been partially read for the parsing of the
expressions, so use the original template data instead.  When the fusion
server receives an incomplete template, we don't receive any answer
back.
2022-12-12 09:31:45 +01:00
Laurent Mignon (ACSONE)
57c4922545 [IMP] report_py3o: prevent injections when retrieving the template from path 2022-12-12 09:31:45 +01:00
Alexis de Lattre
460666b105 [FIX] delete PDF invoice attachment on invoice back to draft (native feature now working with py3o) 2022-12-12 09:31:45 +01:00
Laurent Mignon (ACSONE)
9378e3cab0 [FIX] report_py3o: fix exception when report must be saved as attachement
The mehtod  must be called with a list of ids not with a list of browse records
2022-12-12 09:31:45 +01:00
Laurent Mignon (ACSONE)
ebf14f08ef [IMP] Allow to override/extend the way we get the fallback template 2022-12-12 09:31:45 +01:00
Jonathan Nemry (ACSONE)
bca583e9ad * travis.yml
* flake8
2022-12-12 09:31:45 +01:00
Laurent Mignon
bd3b2e25e2 [IMP] Minimizes memory consumption
Conflicts:
	report_py3o/models/py3o_report.py
2022-12-12 09:31:45 +01:00
Jonathan Nemry (ACSONE)
171a4fd620 [FIX] imports 2022-12-12 09:31:45 +01:00
Laurent Mignon
ac8b189ee8 [IMP] Replace old style parser by TransientModel
The goal is to improve the modularity by making the parser a true inheritable odoo model and share part of the code with the 'report' model

Conflicts:
	report_py3o/models/ir_actions_report_xml.py
	report_py3o/models/py3o_report.py
	report_py3o/tests/test_report_py3o.py
2022-12-12 09:31:45 +01:00