Skip to content

[20.0][MIG] report_xlsx: Migration to 20.0 - #1203

Open
propublisher01 wants to merge 58 commits into
OCA:20.0from
propublisher01:20.0-mig-report_xlsx
Open

propublisher01 wants to merge 58 commits into
OCA:20.0from
propublisher01:20.0-mig-report_xlsx

Conversation

@propublisher01

@propublisher01 propublisher01 commented Sep 28, 2026 •

Copy link
Copy Markdown

Migration of report_xlsx to 20.0 (history preserved with git format-patch / git am).

Changes:

  • odoo.http is now a package: content_disposition is imported from odoo.http.stream and serialize_exception from odoo.http.dispatcher.
  • ir.actions.report no longer has a report_file field: removed from the demo data, the tests and the usage example (README regenerated).

Tested on Odoo 20.0 (nightly 20260928), with demo data:

  • module tests pass;
  • /report/xlsx/... and /report/download return a valid .xlsx file.

The JS report handler needs no change: the ir.actions.report handlers registry and its (action, options, env) signature are unchanged in 20.0.

AI assistance: this migration was prepared with Claude Opus 5.5 (Claude Code); I reviewed and tested every change. Commits carry the corresponding Assisted-by: trailer.

Adrien Peiffer (ACSONE) and others added 3 commits September 28, 2026 14:23
…s to print to the 'create_xlsx_report' method + Instanciate the parser and make it available for the 'generate_xlsx_report' method
@mileo

mileo commented Sep 30, 2026

Copy link
Copy Markdown
Member

Thanks a lot for this migration! It installs and its tests pass locally on 20.0 with a clean log.

One thing blocks it for now: commit 5299985 carries a Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> trailer, and the OCA AI policy does not allow AI tools in authorship fields such as Co-authored-by:. The expected way to disclose AI assistance is an Assisted-by: trailer instead, and the policy also asks to mention it in the PR description:
https://github.com/OCA/.github/blob/master/AI_POLICY.md

Could you please amend that commit, replacing the trailer with Assisted-by: Claude Opus 5.5, and force-push? For example, with the [MIG] commit on top of the branch:

git commit --amend   # edit the message: Co-Authored-By -> Assisted-by
git push --force-with-lease

I will be glad to review again right after.

@propublisher01

Copy link
Copy Markdown
Author

Done, thanks for pointing this out!

@mileo mileo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

micheledic added a commit to stesi/account-financial-reporting that referenced this pull request Oct 5, 2026
…t_xlsx PRs

account_financial_report depends on date_range and report_xlsx. Their
20.0 migrations are open pull requests: OCA/server-ux#1341 and
OCA/reporting-engine#1203. Install them from the pull request heads
until they are merged.
micheledic added a commit to stesi/account-financial-reporting that referenced this pull request Oct 5, 2026
…t_xlsx PRs

account_financial_report depends on date_range and report_xlsx. Their
20.0 migrations are open pull requests: OCA/server-ux#1341 and
OCA/reporting-engine#1203. Install them from the pull request heads
until they are merged.
@micheledic

Copy link
Copy Markdown

@propublisher01 why it is draft ?

@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

micheledic added a commit to stesi/account-financial-reporting that referenced this pull request Oct 6, 2026
…t_xlsx PRs

account_financial_report depends on date_range and report_xlsx. Their
20.0 migrations are open pull requests: OCA/server-ux#1341 and
OCA/reporting-engine#1203. Install them from the pull request heads
until they are merged.
@micheledic

Copy link
Copy Markdown

@propublisher01 can you mark the PR ready so @pedrobaeza can merge?

@propublisher01
propublisher01 marked this pull request as ready for review October 13, 2026 15:21

@carlos-lopez-tecnativa carlos-lopez-tecnativa left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking comment, but it would be great if you could apply this.

Additionally, please squash the administrative commits.
TT64867

Comment thread report_xlsx/tests/test_report.py Outdated
_logger.debug("Can not import openpyxl`.")


class TestReport(common.TransactionCase):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please inherit from BaseCommon and change setUp to setUpClass?

alexis-via and others added 23 commits October 16, 2026 17:17
Currently translated at 23.0% (3 of 13 strings)

Translation: reporting-engine-16.0/reporting-engine-16.0-report_xlsx
Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-16-0/reporting-engine-16-0-report_xlsx/hr/
Currently translated at 100.0% (13 of 13 strings)

Translation: reporting-engine-16.0/reporting-engine-16.0-report_xlsx
Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-16-0/reporting-engine-16-0-report_xlsx/es/
This implements behavior expected when configuring "Save as Attachment Prefix"
within xlsx reports.
Currently translated at 100.0% (7 of 7 strings)

Translation: reporting-engine-17.0/reporting-engine-17.0-report_xlsx
Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-17-0/reporting-engine-17-0-report_xlsx/it/
Currently translated at 100.0% (7 of 7 strings)

Translation: reporting-engine-17.0/reporting-engine-17.0-report_xlsx
Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-17-0/reporting-engine-17-0-report_xlsx/sv/
* report_py3o, report_xlsx, report_xml

odoo core introduced an additional argument in [1] to the method
inherited by report_py3o, report_xlsx, report_xml.
When the same method is inherited in other addons,
it raises a "TypeError: ... takes X positional arguments
but Y were given" due to a mismatch in the argument count.

This commit updates the mentioned method signature to match the
latest odoo core definition, ensuring compatibility and preventing
runtime errors when multiple addons override the same function.

No functional changes are introduced. Only method signatures have
been synchronized with upstream Odoo
Currently translated at 85.7% (6 of 7 strings)

Translation: reporting-engine-18.0/reporting-engine-18.0-report_xlsx
Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-18-0/reporting-engine-18-0-report_xlsx/tr/
Currently translated at 100.0% (7 of 7 strings)

Translation: reporting-engine-18.0/reporting-engine-18.0-report_xlsx
Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-18-0/reporting-engine-18-0-report_xlsx/tr/
- odoo.http is now a package: import content_disposition from
  odoo.http.stream and serialize_exception from odoo.http.dispatcher.
- ir.actions.report no longer has a report_file field: removed from
  the demo data, the tests and the usage example.

Assisted-by: Claude Opus 5.5
@propublisher01

Copy link
Copy Markdown
Author

@carlos-lopez-tecnativa Done: tests now inherit from BaseCommon with setUpClass (test user in base.group_system, since report actions require it), and the administrative commits are squashed (110 → 58 commits, translations from different translators kept separate). Tests pass locally on 20.0. @micheledic ready for merge on my side, thanks!

@pedrobaeza pedrobaeza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a test in the runboat with the demo report, I see that the report is not automatically added to the print menu, so I think you need to add this for getting it (not tested though) and ease the demo testing.

<field name="name">Print to XLSX</field>
<field name="model">res.partner</field>
<field name="report_type">xlsx</field>
<field name="report_name">report_xlsx.partner_xlsx</field>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<field name="report_name">report_xlsx.partner_xlsx</field>
<field name="report_name">report_xlsx.partner_xlsx</field>
<field name="binding_model_id" ref="base.model_res_partner"/>
<field name="binding_type">report</field>

marchar1 added a commit to SuperbirdOdoo/reporting-engine that referenced this pull request Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.