Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[18.0][MIG] report_xlsx_helper #958

Open
wants to merge 71 commits into
base: 18.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
cbc80bd
rename module
luc-demeyer Apr 12, 2018
35de14b
xlsx formats
luc-demeyer Aug 5, 2018
563e53e
improved error handling
luc-demeyer Aug 9, 2018
c179e85
autodetect boolean type
luc-demeyer Aug 10, 2018
d5a7e13
pylint: disable=old-api7-method-defined
luc-demeyer Aug 10, 2018
39a4e9b
pylint: disable=old-api7-method-defined
luc-demeyer Aug 10, 2018
c2edc00
pylint W8112(eval-referenced)
luc-demeyer Aug 10, 2018
a79a584
pylint eval-used
luc-demeyer Aug 10, 2018
d759815
add unit test
luc-demeyer Aug 12, 2018
dc60fba
[UPD] Update report_xlsx_helper.pot
oca-travis Aug 14, 2018
2e14cf2
[11.0][MIG] report_xlsx_helper: Migration to 11.0
luc-demeyer Sep 24, 2018
95aa3ec
add todo
luc-demeyer Sep 26, 2018
79d2c18
[UPD] Update report_xlsx_helper.pot
oca-travis Oct 1, 2018
ea83493
[UPD] README.rst
OCA-git-bot Oct 2, 2018
9e14db0
[10.0][FIX]fix _render for cell formats
luc-demeyer Nov 4, 2018
f67da48
[MIG] : Migration to 12.0
luc-demeyer Apr 21, 2019
a2c02bc
[UPD] README.rst
OCA-git-bot Jun 3, 2019
a0c1834
[UPD] Update report_xlsx_helper.pot
oca-travis Jun 3, 2019
8b62b0d
[UPD] README.rst
OCA-git-bot Jul 31, 2019
3e876ca
date to datetime conversion when autotyping
luc-demeyer Aug 7, 2019
44ef7d4
greenify
luc-demeyer Aug 8, 2019
a00985a
increase test coverage
luc-demeyer Aug 10, 2019
22d7a61
[UPD] Update report_xlsx_helper.pot
oca-travis Oct 1, 2019
aebdf91
report_xlsx_helper 12.0.1.1.0
OCA-git-bot Oct 1, 2019
e393399
FIX error message when cellvalue's type is not recognized
ivantodorovich Sep 6, 2019
dad38c6
report_xlsx_helper 12.0.1.1.1
OCA-git-bot Oct 10, 2019
93883e3
[IMP] report_xlsx_helper: black, isort
kongrattapong Jan 9, 2020
5dc20dd
[MIG] report_xlsx_helper: Migration to 13.0
kongrattapong Jan 9, 2020
a51dce2
[UPD] Update report_xlsx_helper.pot
oca-travis Feb 19, 2020
48ad369
[UPD] README.rst
OCA-git-bot Feb 19, 2020
27a0094
report_xlsx_helper 13.0.1.0.1
OCA-git-bot Feb 19, 2020
bb9b07f
[12.0][ENH] report_xlsx_helper : dynamic function _write_line
Saran440 Jan 22, 2020
4e96e4c
greenify
luc-demeyer Feb 20, 2020
8a68559
[UPD] README.rst
OCA-git-bot Feb 21, 2020
493ebcb
report_xlsx_helper 13.0.1.1.0
OCA-git-bot Feb 21, 2020
92515d7
[14.0][MIG] report_xlsx_helper
Saran440 Nov 19, 2020
e5c1d83
[IMP] format xlsx to global files
Saran440 Nov 19, 2020
299c48b
[UPD] Update report_xlsx_helper.pot
oca-travis Dec 2, 2020
63302de
[FIX] report_xlsx_helper: force Libreoffice to recompute formulas
StefanRijnhart Feb 9, 2021
eb43a78
Added translation using Weblate (Spanish)
anasuarez1 Mar 16, 2021
1f92b97
Translated using Weblate (Spanish)
anasuarez1 Mar 16, 2021
eab428d
report_xlsx_helper 14.0.1.0.1
OCA-git-bot Nov 8, 2021
33fad43
[IMP] report_xlsx_helper: black, isort, prettier
Jan 19, 2022
96f5c17
[MIG] report_xlsx_helper: Migration to 15.0
Jan 19, 2022
013f8b2
[UPD] Update report_xlsx_helper.pot
Feb 20, 2022
a9be8d1
[UPD] README.rst
OCA-git-bot Feb 20, 2022
78151fd
[FIX]report_xlsx_helper: Development status mature
manuelregidor Apr 13, 2022
7b55e1a
[UPD] README.rst
OCA-git-bot Apr 13, 2022
e46bf51
report_xlsx_helper 15.0.1.0.1
OCA-git-bot Apr 13, 2022
57c92ea
Added translation using Weblate (Catalan)
jabelchi Jun 15, 2022
8a84bbf
Translated using Weblate (Catalan)
jabelchi Jun 15, 2022
126f198
[MIG] report_xlsx_helper: Migration to 16.0
RodrigoBM Oct 6, 2022
dbb5572
[UPD] Update report_xlsx_helper.pot
Dec 5, 2022
cdd2a7d
[UPD] README.rst
OCA-git-bot Dec 5, 2022
51a9206
Update translation files
weblate Dec 5, 2022
8eb5036
Translated using Weblate (Spanish)
Ivorra78 Jul 18, 2023
93bda2b
Translated using Weblate (Spanish)
Ivorra78 Aug 23, 2023
25f37f9
[UPD] README.rst
OCA-git-bot Sep 3, 2023
67fbb8c
Update translation files
weblate Oct 10, 2023
18988cd
Translated using Weblate (Spanish)
Ivorra78 Oct 15, 2023
fa7d3d3
[IMP] report_xlsx_helper: pre-commit auto fixes
FernandoRomera Dec 20, 2023
263ceff
[17.0][MIG] report_xlsx_helper: Migration to 17.0
FernandoRomera Dec 20, 2023
f0c8a3c
[UPD] Update report_xlsx_helper.pot
Jan 23, 2024
5220adb
[BOT] post-merge updates
OCA-git-bot Jan 23, 2024
69a1b0f
Added translation using Weblate (Italian)
mymage Feb 5, 2024
db26ff9
Translated using Weblate (Italian)
mymage Feb 12, 2024
b372087
[FIX] *: line too long
pedrobaeza May 2, 2024
c2c06d7
[BOT] post-merge updates
OCA-git-bot May 2, 2024
451d78b
Added translation using Weblate (French)
epanisset Nov 8, 2024
925dda1
[IMP] report_xlsx_helper: pre-commit fixes
alexis-via Jan 3, 2025
fa2fb0d
[MIG] report_xlsx_helper: migrate from v17 to v18
alexis-via Jan 3, 2025
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
127 changes: 127 additions & 0 deletions report_xlsx_helper/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
===================
Report xlsx helpers
===================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:df481003a65f02d5bf2edcc90f4238033b81c3fa5120209c2e36e25b1cdabb77
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Mature-brightgreen.png
:target: https://odoo-community.org/page/development-status
:alt: Mature
.. |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/18.0/report_xlsx_helper
: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-18-0/reporting-engine-18-0-report_xlsx_helper
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/reporting-engine&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module provides a set of tools to facilitate the creation of excel
reports with format xlsx.

**Table of contents**

.. contents::
:local:

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

This module requires report_xlsx version 13.0.1.0.0 or higher.

Usage
=====

In order to create an Excel report you can define a report of type
'xlsx' in a static or dynamic way:

- Static syntax: cf. ``account_move_line_report_xls`` for an example.
- Dynamic syntax: cf. ``report_xlsx_helper_demo`` for an example

The ``AbstractReportXlsx`` class contains a number of attributes and
methods to facilitate the creation excel reports in Odoo.

- Cell types

string, number, boolean, datetime.

- Cell formats

The predefined cell formats result in a consistent look and feel of
the Odoo Excel reports.

- Cell formulas

Cell formulas can be easily added with the help of the
``_rowcol_to_cell()`` method.

- Excel templates

It is possible to define Excel templates which can be adapted by
'inherited' modules. Download the ``account_move_line_report_xls``
module from http://apps.odoo.com as example.

- Excel with multiple sheets

Download the ``account_asset_management_xls`` module from
http://apps.odoo.com as example.

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 to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_xlsx_helper%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Noviat

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

- Luc De Meyer <luc.demeyer@noviat.com>

- Rattapong Chokmasermkul <rattapongc@ecosoft.co.th>

- Saran Lim. <saranl@ecosoft.co.th>

- `Sinerkia Innovación y Desarrollo S.L. <https://www.sinerkia.com>`__:

- Luis Pomar

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

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 <https://github.com/OCA/reporting-engine/tree/18.0/report_xlsx_helper>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions report_xlsx_helper/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import controllers
from . import models
from . import report
14 changes: 14 additions & 0 deletions report_xlsx_helper/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2009-2019 Noviat.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Report xlsx helpers",
"author": "Noviat, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/reporting-engine",
"category": "Reporting",
"version": "18.0.1.0.0",
"license": "AGPL-3",
"depends": ["report_xlsx"],
"development_status": "Mature",
"installable": True,
}
1 change: 1 addition & 0 deletions report_xlsx_helper/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import main
51 changes: 51 additions & 0 deletions report_xlsx_helper/controllers/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Copyright 2009-2018 Noviat.
# License AGPL-3.0 or later (https://www.gnuorg/licenses/agpl.html).

import json

from odoo.http import content_disposition, request, route

from odoo.addons.report_xlsx.controllers.main import ReportController


class ReportController(ReportController):
@route(
[
"/report/<converter>/<reportname>",
"/report/<converter>/<reportname>/<docids>",
],
type="http",
auth="user",
website=True,
)
def report_routes(self, reportname, docids=None, converter=None, **data):
report = request.env["ir.actions.report"]._get_report_from_name(reportname)

Check warning on line 22 in report_xlsx_helper/controllers/main.py

View check run for this annotation

Codecov / codecov/patch

report_xlsx_helper/controllers/main.py#L22

Added line #L22 was not covered by tests
if converter == "xlsx" and not report:
context = dict(request.env.context)

Check warning on line 24 in report_xlsx_helper/controllers/main.py

View check run for this annotation

Codecov / codecov/patch

report_xlsx_helper/controllers/main.py#L24

Added line #L24 was not covered by tests
if docids:
docids = [int(i) for i in docids.split(",")]

Check warning on line 26 in report_xlsx_helper/controllers/main.py

View check run for this annotation

Codecov / codecov/patch

report_xlsx_helper/controllers/main.py#L26

Added line #L26 was not covered by tests
if data.get("options"):
data.update(json.loads(data.pop("options")))

Check warning on line 28 in report_xlsx_helper/controllers/main.py

View check run for this annotation

Codecov / codecov/patch

report_xlsx_helper/controllers/main.py#L28

Added line #L28 was not covered by tests
if data.get("context"):
data["context"] = json.loads(data["context"])
context.update(data["context"])
context["report_name"] = reportname

Check warning on line 32 in report_xlsx_helper/controllers/main.py

View check run for this annotation

Codecov / codecov/patch

report_xlsx_helper/controllers/main.py#L30-L32

Added lines #L30 - L32 were not covered by tests

xlsx = report.with_context(**context)._render_xlsx(

Check warning on line 34 in report_xlsx_helper/controllers/main.py

View check run for this annotation

Codecov / codecov/patch

report_xlsx_helper/controllers/main.py#L34

Added line #L34 was not covered by tests
reportname, docids, data=data
)[0]
report_file = context.get("report_file")

Check warning on line 37 in report_xlsx_helper/controllers/main.py

View check run for this annotation

Codecov / codecov/patch

report_xlsx_helper/controllers/main.py#L37

Added line #L37 was not covered by tests
if not report_file:
active_model = context.get("active_model", "export")
report_file = active_model.replace(".", "_")
xlsxhttpheaders = [

Check warning on line 41 in report_xlsx_helper/controllers/main.py

View check run for this annotation

Codecov / codecov/patch

report_xlsx_helper/controllers/main.py#L39-L41

Added lines #L39 - L41 were not covered by tests
(
"Content-Type",
"application/vnd.openxmlformats-"
"officedocument.spreadsheetml.sheet",
),
("Content-Length", len(xlsx)),
("Content-Disposition", content_disposition(report_file + ".xlsx")),
]
return request.make_response(xlsx, headers=xlsxhttpheaders)
return super().report_routes(reportname, docids, converter, **data)

Check warning on line 51 in report_xlsx_helper/controllers/main.py

View check run for this annotation

Codecov / codecov/patch

report_xlsx_helper/controllers/main.py#L50-L51

Added lines #L50 - L51 were not covered by tests
129 changes: 129 additions & 0 deletions report_xlsx_helper/i18n/ca.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * report_xlsx_helper
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2022-06-15 18:05+0000\n"
"Last-Translator: jabelchi <jabelchi@gmail.com>\n"
"Language-Team: none\n"
"Language: ca\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.3.2\n"

#. module: report_xlsx_helper
#. odoo-python
#: code:addons/report_xlsx_helper/report/report_xlsx_abstract.py:0
#, python-format
msgid ""
"%(__name__)s, _write_line : programming error detected while processing "
"col_specs_section %(col_specs_section)s, column %(col)s"
msgstr ""
"%(__name__)s, _write_line : error de programació detectat en processar "
"col_specs_section %(col_specs_section)s, columna %(col)s"

#. module: report_xlsx_helper
#. odoo-python
#: code:addons/report_xlsx_helper/models/ir_actions_report.py:0
#, python-format
msgid "%s model was not found"
msgstr "No s'ha trobat el model %s"

#. module: report_xlsx_helper
#. odoo-python
#: code:addons/report_xlsx_helper/report/report_xlsx_abstract.py:0
#, python-format
msgid ", cellvalue %s"
msgstr ""

#. module: report_xlsx_helper
#: model:ir.model,name:report_xlsx_helper.model_report_report_xlsx_abstract
#, fuzzy
msgid "Abstract XLSX Report"
msgstr "Informe XLSX abstracte"

#. module: report_xlsx_helper
#. odoo-python
#: code:addons/report_xlsx_helper/report/report_xlsx_abstract.py:0
#, python-format
msgid ""
"Programming Error:\n"
"\n"
"Excel Sheet name '%(name)s' contains unsupported special characters: "
"'%(special_chars)s'."
msgstr ""
"Error de programació:\n"
"\n"
"El full Excel amb nom '%(name)s' contè caràcters especials no soportats: "
"'%(special_chars)s'."

#. module: report_xlsx_helper
#. odoo-python
#: code:addons/report_xlsx_helper/report/report_xlsx_abstract.py:0
#, python-format
msgid ""
"Programming Error:\n"
"\n"
"Excel Sheet name '%(name)s' should not exceed %(max_chars)s characters."
msgstr ""
"Error de programació:\n"
"\n"
"El full d'Excel de nom '%(name)s' no hauria d'excedir els %(max_chars)s "
"caràcters."

#. module: report_xlsx_helper
#. odoo-python
#: code:addons/report_xlsx_helper/report/report_xlsx_abstract.py:0
#, python-format
msgid ""
"Programming Error:\n"
"\n"
"The '%s' column is not defined in the worksheet column specifications."
msgstr ""
"Error de programació:\n"
"\n"
"La columna '%s' no està definida a les especificacions de columna del full "
"de càlcul."

#. module: report_xlsx_helper
#. odoo-python
#: code:addons/report_xlsx_helper/report/report_xlsx_abstract.py:0
#, python-format
msgid ""
"Programming Error:\n"
"\n"
"The '%s' column is not defined the worksheet column specifications."
msgstr ""
"Error de programació:\n"
"\n"
"La columna '%s' no està definida a les especificacions de columna del full "
"de càlcul."

#. module: report_xlsx_helper
#. odoo-python
#: code:addons/report_xlsx_helper/report/report_xlsx_abstract.py:0
#, python-format
msgid ""
"Programming Error:\n"
"\n"
"The 'title' parameter is mandatory when calling the '_write_ws_title' method."
msgstr ""
"Error de programació:\n"
"\n"
"El paràmetre 'títol' és obligatori si es crida el mètode '_write_ws_title'."

#. module: report_xlsx_helper
#: model:ir.model,name:report_xlsx_helper.model_ir_actions_report
msgid "Report Action"
msgstr "Acció d'informe"

#. module: report_xlsx_helper
#: model:ir.model,name:report_xlsx_helper.model_report_report_xlsx_helper_test_partner_xlsx
#, fuzzy
msgid "Test Partner XLSX Report"
msgstr "Informe XLSX partner prova"
Loading
Loading