Skip to content

Commit 4ca6b2c

Browse files
committed
Merge PR #831 into 17.0
Signed-off-by alexis-via
2 parents 304c394 + 18dfe7a commit 4ca6b2c

23 files changed

+2163
-0
lines changed

report_xlsx_helper/README.rst

+127
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
===================
2+
Report xlsx helpers
3+
===================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:07e670ba3bc592076c782c24a73763641c491d37b4e44f75b894ea10315a47bb
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Mature-brightgreen.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Mature
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github
20+
:target: https://github.com/OCA/reporting-engine/tree/17.0/report_xlsx_helper
21+
:alt: OCA/reporting-engine
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/reporting-engine-17-0/reporting-engine-17-0-report_xlsx_helper
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/reporting-engine&target_branch=17.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
This module provides a set of tools to facilitate the creation of excel
32+
reports with format xlsx.
33+
34+
**Table of contents**
35+
36+
.. contents::
37+
:local:
38+
39+
Installation
40+
============
41+
42+
This module requires report_xlsx version 13.0.1.0.0 or higher.
43+
44+
Usage
45+
=====
46+
47+
In order to create an Excel report you can define a report of type
48+
'xlsx' in a static or dynamic way:
49+
50+
- Static syntax: cf. ``account_move_line_report_xls`` for an example.
51+
- Dynamic syntax: cf. ``report_xlsx_helper_demo`` for an example
52+
53+
The ``AbstractReportXlsx`` class contains a number of attributes and
54+
methods to facilitate the creation excel reports in Odoo.
55+
56+
- Cell types
57+
58+
string, number, boolean, datetime.
59+
60+
- Cell formats
61+
62+
The predefined cell formats result in a consistent look and feel of
63+
the Odoo Excel reports.
64+
65+
- Cell formulas
66+
67+
Cell formulas can be easily added with the help of the
68+
``_rowcol_to_cell()`` method.
69+
70+
- Excel templates
71+
72+
It is possible to define Excel templates which can be adapted by
73+
'inherited' modules. Download the ``account_move_line_report_xls``
74+
module from http://apps.odoo.com as example.
75+
76+
- Excel with multiple sheets
77+
78+
Download the ``account_asset_management_xls`` module from
79+
http://apps.odoo.com as example.
80+
81+
Bug Tracker
82+
===========
83+
84+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/reporting-engine/issues>`_.
85+
In case of trouble, please check there if your issue has already been reported.
86+
If you spotted it first, help us to smash it by providing a detailed and welcomed
87+
`feedback <https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_xlsx_helper%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
88+
89+
Do not contact contributors directly about support or help with technical issues.
90+
91+
Credits
92+
=======
93+
94+
Authors
95+
-------
96+
97+
* Noviat
98+
99+
Contributors
100+
------------
101+
102+
- Luc De Meyer <luc.demeyer@noviat.com>
103+
104+
- Rattapong Chokmasermkul <rattapongc@ecosoft.co.th>
105+
106+
- Saran Lim. <saranl@ecosoft.co.th>
107+
108+
- `Sinerkia Innovación y Desarrollo S.L. <https://www.sinerkia.com>`__:
109+
110+
- Luis Pomar
111+
112+
Maintainers
113+
-----------
114+
115+
This module is maintained by the OCA.
116+
117+
.. image:: https://odoo-community.org/logo.png
118+
:alt: Odoo Community Association
119+
:target: https://odoo-community.org
120+
121+
OCA, or the Odoo Community Association, is a nonprofit organization whose
122+
mission is to support the collaborative development of Odoo features and
123+
promote its widespread use.
124+
125+
This module is part of the `OCA/reporting-engine <https://github.com/OCA/reporting-engine/tree/17.0/report_xlsx_helper>`_ project on GitHub.
126+
127+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

report_xlsx_helper/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from . import controllers
2+
from . import models
3+
from . import report

report_xlsx_helper/__manifest__.py

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright 2009-2019 Noviat.
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3+
4+
{
5+
"name": "Report xlsx helpers",
6+
"author": "Noviat, Odoo Community Association (OCA)",
7+
"website": "https://github.com/OCA/reporting-engine",
8+
"category": "Reporting",
9+
"version": "17.0.1.0.0",
10+
"license": "AGPL-3",
11+
"depends": ["report_xlsx"],
12+
"development_status": "Mature",
13+
"installable": True,
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import main
+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Copyright 2009-2018 Noviat.
2+
# License AGPL-3.0 or later (https://www.gnuorg/licenses/agpl.html).
3+
4+
import json
5+
6+
from odoo.http import content_disposition, request, route
7+
8+
from odoo.addons.report_xlsx.controllers.main import ReportController
9+
10+
11+
class ReportController(ReportController):
12+
@route(
13+
[
14+
"/report/<converter>/<reportname>",
15+
"/report/<converter>/<reportname>/<docids>",
16+
],
17+
type="http",
18+
auth="user",
19+
website=True,
20+
)
21+
def report_routes(self, reportname, docids=None, converter=None, **data):
22+
report = request.env["ir.actions.report"]._get_report_from_name(reportname)
23+
if converter == "xlsx" and not report:
24+
context = dict(request.env.context)
25+
if docids:
26+
docids = [int(i) for i in docids.split(",")]
27+
if data.get("options"):
28+
data.update(json.loads(data.pop("options")))
29+
if data.get("context"):
30+
data["context"] = json.loads(data["context"])
31+
context.update(data["context"])
32+
context["report_name"] = reportname
33+
34+
xlsx = report.with_context(**context)._render_xlsx(
35+
reportname, docids, data=data
36+
)[0]
37+
report_file = context.get("report_file")
38+
if not report_file:
39+
active_model = context.get("active_model", "export")
40+
report_file = active_model.replace(".", "_")
41+
xlsxhttpheaders = [
42+
(
43+
"Content-Type",
44+
"application/vnd.openxmlformats-"
45+
"officedocument.spreadsheetml.sheet",
46+
),
47+
("Content-Length", len(xlsx)),
48+
("Content-Disposition", content_disposition(report_file + ".xlsx")),
49+
]
50+
return request.make_response(xlsx, headers=xlsxhttpheaders)
51+
return super().report_routes(reportname, docids, converter, **data)

report_xlsx_helper/i18n/ca.po

+129
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * report_xlsx_helper
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 15.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"PO-Revision-Date: 2022-06-15 18:05+0000\n"
10+
"Last-Translator: jabelchi <jabelchi@gmail.com>\n"
11+
"Language-Team: none\n"
12+
"Language: ca\n"
13+
"MIME-Version: 1.0\n"
14+
"Content-Type: text/plain; charset=UTF-8\n"
15+
"Content-Transfer-Encoding: \n"
16+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
17+
"X-Generator: Weblate 4.3.2\n"
18+
19+
#. module: report_xlsx_helper
20+
#. odoo-python
21+
#: code:addons/report_xlsx_helper/report/report_xlsx_abstract.py:0
22+
#, python-format
23+
msgid ""
24+
"%(__name__)s, _write_line : programming error detected while processing "
25+
"col_specs_section %(col_specs_section)s, column %(col)s"
26+
msgstr ""
27+
"%(__name__)s, _write_line : error de programació detectat en processar "
28+
"col_specs_section %(col_specs_section)s, columna %(col)s"
29+
30+
#. module: report_xlsx_helper
31+
#. odoo-python
32+
#: code:addons/report_xlsx_helper/models/ir_actions_report.py:0
33+
#, python-format
34+
msgid "%s model was not found"
35+
msgstr "No s'ha trobat el model %s"
36+
37+
#. module: report_xlsx_helper
38+
#. odoo-python
39+
#: code:addons/report_xlsx_helper/report/report_xlsx_abstract.py:0
40+
#, python-format
41+
msgid ", cellvalue %s"
42+
msgstr ""
43+
44+
#. module: report_xlsx_helper
45+
#: model:ir.model,name:report_xlsx_helper.model_report_report_xlsx_abstract
46+
#, fuzzy
47+
msgid "Abstract XLSX Report"
48+
msgstr "Informe XLSX abstracte"
49+
50+
#. module: report_xlsx_helper
51+
#. odoo-python
52+
#: code:addons/report_xlsx_helper/report/report_xlsx_abstract.py:0
53+
#, python-format
54+
msgid ""
55+
"Programming Error:\n"
56+
"\n"
57+
"Excel Sheet name '%(name)s' contains unsupported special characters: "
58+
"'%(special_chars)s'."
59+
msgstr ""
60+
"Error de programació:\n"
61+
"\n"
62+
"El full Excel amb nom '%(name)s' contè caràcters especials no soportats: "
63+
"'%(special_chars)s'."
64+
65+
#. module: report_xlsx_helper
66+
#. odoo-python
67+
#: code:addons/report_xlsx_helper/report/report_xlsx_abstract.py:0
68+
#, python-format
69+
msgid ""
70+
"Programming Error:\n"
71+
"\n"
72+
"Excel Sheet name '%(name)s' should not exceed %(max_chars)s characters."
73+
msgstr ""
74+
"Error de programació:\n"
75+
"\n"
76+
"El full d'Excel de nom '%(name)s' no hauria d'excedir els %(max_chars)s "
77+
"caràcters."
78+
79+
#. module: report_xlsx_helper
80+
#. odoo-python
81+
#: code:addons/report_xlsx_helper/report/report_xlsx_abstract.py:0
82+
#, python-format
83+
msgid ""
84+
"Programming Error:\n"
85+
"\n"
86+
"The '%s' column is not defined in the worksheet column specifications."
87+
msgstr ""
88+
"Error de programació:\n"
89+
"\n"
90+
"La columna '%s' no està definida a les especificacions de columna del full "
91+
"de càlcul."
92+
93+
#. module: report_xlsx_helper
94+
#. odoo-python
95+
#: code:addons/report_xlsx_helper/report/report_xlsx_abstract.py:0
96+
#, python-format
97+
msgid ""
98+
"Programming Error:\n"
99+
"\n"
100+
"The '%s' column is not defined the worksheet column specifications."
101+
msgstr ""
102+
"Error de programació:\n"
103+
"\n"
104+
"La columna '%s' no està definida a les especificacions de columna del full "
105+
"de càlcul."
106+
107+
#. module: report_xlsx_helper
108+
#. odoo-python
109+
#: code:addons/report_xlsx_helper/report/report_xlsx_abstract.py:0
110+
#, python-format
111+
msgid ""
112+
"Programming Error:\n"
113+
"\n"
114+
"The 'title' parameter is mandatory when calling the '_write_ws_title' method."
115+
msgstr ""
116+
"Error de programació:\n"
117+
"\n"
118+
"El paràmetre 'títol' és obligatori si es crida el mètode '_write_ws_title'."
119+
120+
#. module: report_xlsx_helper
121+
#: model:ir.model,name:report_xlsx_helper.model_ir_actions_report
122+
msgid "Report Action"
123+
msgstr "Acció d'informe"
124+
125+
#. module: report_xlsx_helper
126+
#: model:ir.model,name:report_xlsx_helper.model_report_report_xlsx_helper_test_partner_xlsx
127+
#, fuzzy
128+
msgid "Test Partner XLSX Report"
129+
msgstr "Informe XLSX partner prova"

0 commit comments

Comments
 (0)