Skip to content

Commit

Permalink
[MIG] report_xlsx: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dariodelzozzo committed Oct 25, 2024
1 parent 19db079 commit bc4c589
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 28 deletions.
32 changes: 16 additions & 16 deletions report_xlsx/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ Base report xlsx
: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/17.0/report_xlsx
:target: https://github.com/OCA/reporting-engine/tree/18.0/report_xlsx
: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-17-0/reporting-engine-17-0-report_xlsx
:target: https://translation.odoo-community.org/projects/reporting-engine-18-0/reporting-engine-18-0-report_xlsx
: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=17.0
: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|
Expand Down Expand Up @@ -99,7 +99,7 @@ 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%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_xlsx%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.

Expand All @@ -115,17 +115,17 @@ Authors
Contributors
------------

- Adrien Peiffer <[email protected]>
- Sébastien Alix <[email protected]>
- Stéphane Bidoul <[email protected]>
- Enric Tobella <[email protected]>
- Graeme Gellatly <[email protected]>
- Cristian Salamea <[email protected]>
- Rod Schouteden <[email protected]>
- Eugene Molotov <[email protected]>
- Christopher Ormaza <[email protected]>
- Houzéfa Abbasbhay <[email protected]>
- Le Dinh Tien <[email protected]>
- Adrien Peiffer <[email protected]>
- Sébastien Alix <[email protected]>
- Stéphane Bidoul <[email protected]>
- Enric Tobella <[email protected]>
- Graeme Gellatly <[email protected]>
- Cristian Salamea <[email protected]>
- Rod Schouteden <[email protected]>
- Eugene Molotov <[email protected]>
- Christopher Ormaza <[email protected]>
- Houzéfa Abbasbhay <[email protected]>
- Le Dinh Tien <[email protected]>

Maintainers
-----------
Expand All @@ -140,6 +140,6 @@ 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/17.0/report_xlsx>`_ project on GitHub.
This module is part of the `OCA/reporting-engine <https://github.com/OCA/reporting-engine/tree/18.0/report_xlsx>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 1 addition & 1 deletion report_xlsx/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"author": "ACSONE SA/NV," "Creu Blanca," "Odoo Community Association (OCA)",
"website": "https://github.com/OCA/reporting-engine",
"category": "Reporting",
"version": "17.0.1.0.1",
"version": "18.0.1.0.0",
"development_status": "Mature",
"license": "AGPL-3",
"external_dependencies": {"python": ["xlsxwriter", "xlrd"]},
Expand Down
2 changes: 1 addition & 1 deletion report_xlsx/models/ir_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ReportAction(models.Model):
@api.model
def _render_xlsx(self, report_ref, docids, data):
report_sudo = self._get_report(report_ref)
report_model_name = "report.%s" % report_sudo.report_name
report_model_name = f"report.{report_sudo.report_name}"
report_model = self.env[report_model_name]
ret = (
report_model.with_context(active_model=report_sudo.model)
Expand Down
2 changes: 1 addition & 1 deletion report_xlsx/report/report_abstract_xlsx.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def _report_xlsx_currency_format(self, currency):
"""Get the format to be used in cells (symbol included).
Used in account_financial_report addon"""
s_before = currency.symbol if currency.position == "before" else ""
s_after = " %s" % currency.symbol if currency.position == "after" else ""
s_after = f" {currency.symbol}" if currency.position == "after" else ""
return f"{f'{s_before}'}#,##0.{'0' * currency.decimal_places}{f'{s_after}'}"

def create_xlsx_report(self, docids, data):
Expand Down
6 changes: 3 additions & 3 deletions report_xlsx/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ <h1 class="title">Base report xlsx</h1>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:0cdb111ad7244341d95a941ae568244595e3dd96993c951fd16992da581afb0f
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Mature" src="https://img.shields.io/badge/maturity-Mature-brightgreen.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/reporting-engine/tree/17.0/report_xlsx"><img alt="OCA/reporting-engine" src="https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/reporting-engine-17-0/reporting-engine-17-0-report_xlsx"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/reporting-engine&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Mature" src="https://img.shields.io/badge/maturity-Mature-brightgreen.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/reporting-engine/tree/18.0/report_xlsx"><img alt="OCA/reporting-engine" src="https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/reporting-engine-18-0/reporting-engine-18-0-report_xlsx"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/reporting-engine&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module provides a basic report class to generate xlsx report.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
Expand Down Expand Up @@ -438,7 +438,7 @@ <h1><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/reporting-engine/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_xlsx%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_xlsx%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand Down Expand Up @@ -475,7 +475,7 @@ <h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/reporting-engine/tree/17.0/report_xlsx">OCA/reporting-engine</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/reporting-engine/tree/18.0/report_xlsx">OCA/reporting-engine</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down
9 changes: 3 additions & 6 deletions report_xlsx/static/src/js/report/action_manager_report.esm.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/** @odoo-module **/

import {download} from "@web/core/network/download";
import {registry} from "@web/core/registry";
import {user} from "@web/core/user";

registry
.category("ir.actions.report handlers")
Expand All @@ -21,9 +20,7 @@ registry
url += `/${actionContext.active_ids.join(",")}`;
}
if (type === "xlsx") {
const context = encodeURIComponent(
JSON.stringify(env.services.user.context)
);
const context = encodeURIComponent(JSON.stringify(user.context));
url += `?context=${context}`;
}
}
Expand All @@ -33,7 +30,7 @@ registry
url: "/report/download",
data: {
data: JSON.stringify([url, action.report_type]),
context: JSON.stringify(env.services.user.context),
context: JSON.stringify(user.context),
},
});
} finally {
Expand Down

0 comments on commit bc4c589

Please sign in to comment.