Skip to content

Conversation

@Qlasta
Copy link

@Qlasta Qlasta commented Apr 15, 2025

task no. 25641
most of the changes copied from OCA PR, tested locally.

ernestotejeda and others added 30 commits January 10, 2025 10:26
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: reporting-engine-12.0/reporting-engine-12.0-report_xml
Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-12-0/reporting-engine-12-0-report_xml/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: reporting-engine-13.0/reporting-engine-13.0-report_xml
Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-13-0/reporting-engine-13-0-report_xml/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: reporting-engine-13.0/reporting-engine-13.0-report_xml
Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-13-0/reporting-engine-13-0-report_xml/
* No longer need `with Environment.manage()`
* Assets are registered in manifest file now
* ReportController endpoints no longer take a `token` parameter
* The frontend ActionManager has been rewritten as an Owl service
Currently translated at 94.4% (17 of 18 strings)

Translation: reporting-engine-15.0/reporting-engine-15.0-report_xml
Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-15-0/reporting-engine-15-0-report_xml/ca/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: reporting-engine-16.0/reporting-engine-16.0-report_xml
Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-16-0/reporting-engine-16-0-report_xml/
Adds a way to choose the file extension for your XML file, by adding the flexibility of appending more choices.
For example, instead of getting `.xml`, this allows to have the report download as `.svg` or even good old `.html` if needed.
This is also very useful for some localization purposes, where some scarce software uses uncommon file extensions for their XML files, like `.ffdata` for specific accounting reports here in Lithuania.

The change is not breaking, as we set the default to be `.xml` like it was by default anyway.
OCA-git-bot and others added 16 commits April 15, 2025 16:21
Currently translated at 100.0% (46 of 46 strings)

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

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

Translation: reporting-engine-16.0/reporting-engine-16.0-report_py3o
Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-16-0/reporting-engine-16-0-report_py3o/it/
@Qlasta Qlasta force-pushed the 18.0-mig-report-py3o branch from f0421f8 to b965830 Compare April 15, 2025 13:23
@Qlasta Qlasta marked this pull request as ready for review April 15, 2025 13:24
@Qlasta Qlasta requested review from a team and dz0 and removed request for a team April 15, 2025 13:25
Copy link

@dz0 dz0 left a comment

Choose a reason for hiding this comment

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

What was most complicated or needs more review attention?

@Qlasta
Copy link
Author

Qlasta commented Apr 16, 2025

[18.0][MIG] report_py3o

@dz0 can you just double check [18.0][MIG] report_py3o for any obvious mistakes.

@Qlasta Qlasta requested a review from dz0 April 16, 2025 07:42
Copy link

@dz0 dz0 left a comment

Choose a reason for hiding this comment

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

So it is ported from v16 directly to v18?
Strange, that no v17 available around...

Comment on lines 85 to 86
data = list(url_decode(url.split("?")[1]).items())
data = list(MultiDict(parse_qs(url.split("?")[1])).items())
Copy link

Choose a reason for hiding this comment

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

Why do you use MultiDict here?
it may lose some info if we have query from checkboxes-like form.
example qs: ?a=1&a=2&b=3

>>> md = MultiDict({"a":[1, 2], "b":3})
>>> md
MultiDict([('a', 1), ('a', 2), ('b', 3)])

>>> list(md.items())
[('a', 1), ('b', 3)]    # no more   a=2  info

Copy link

Choose a reason for hiding this comment

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

without Multidict it would be

>>> list({"a":[1, 2], "b":3}.items())
[('a', [1, 2]), ('b', 3)]

also can use parse_qsl variant:

data = parse_qsl(url.split("?")[1])
>>> mylist = parse_qsl("a=1&a=2&b=3")
>>> mylist
... [('a', 1), ('a', 2), ('b', 3)]

# If passed to dict, it will leave just **last** value of `a`  (where's MultiDict leaves **first**)
>>> dict(mylist)
... {'a': 2, 'b': 3}

Copy link

Choose a reason for hiding this comment

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

I see later data is passed to report_routes

so depends how it will be handled futher -- inside of _render_qweb_[pdf/html/txt/xml]...?

and finally -- will it ever get those multiple param values?

Maybe final-decider would know?

If not clear: would leave at least comment (maybe link to this discussion).

Copy link
Author

Choose a reason for hiding this comment

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

@dz0, this I copied from OCA migration PR and also do not see any comment why it was changed. Although these changes was approved. Will try to check which format will be passed here, but I think will leave this change for now.

Copy link
Author

Choose a reason for hiding this comment

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

I checked a bit, but did not find out much. But as it is implemented similar way before the change, I think there shouldn't be multiple values for same parameter. Of course one can pass it still, but should expect to to work with multiple.

Comment on lines 13 to 16
_.isUndefined(action.data) ||
_.isNull(action.data) ||
(_.isObject(action.data) && _.isEmpty(action.data))
action.data === undefined ||
action.data === null ||
(typeof action.data === "object" &&
Object.keys(action.data).length === 0)
Copy link

Choose a reason for hiding this comment

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

Here I see was used lodash -- is change needed to get rid of it?

Copy link
Author

Choose a reason for hiding this comment

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

This also was changed and approved from OCA

Comment on lines 36 to 37
context: JSON.stringify(env.services.user.context),
context: JSON.stringify(action.context),
Copy link

Choose a reason for hiding this comment

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

curious: how do you know that it should be action now?
any docs/log of API change?

Copy link
Author

Choose a reason for hiding this comment

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

This also was copied form orig.

@dz0 dz0 requested review from a team and oerp-odoo and removed request for a team April 16, 2025 07:53
from PyPDF2.pdf import PageObject

try:
# For PyPDF2 <= 1.26.0

Choose a reason for hiding this comment

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

Is 18.0 still rely on olrder PyPDF2? if not, we should just assume latest version.

Copy link
Author

Choose a reason for hiding this comment

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

@oerp-odoo ir depends on python, maybe someone uses older versions: https://github.com/odoo/odoo/blob/18.0/requirements.txt#L57-L58. Or I should leave newer for our needs?

Copy link

@oerp-odoo oerp-odoo Apr 16, 2025

Choose a reason for hiding this comment

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

Well Odoo 18 enforces some minimum python, like I think its 3.10. So it might be that it is actually now impossible to use older PyPDF2 at all. Can you check if thats the case? If so, we can drop this check.

Oh I see 3.10 still includes older one:). Then lets keep it as is.

@Qlasta Qlasta merged commit b965830 into 18.0-versada Apr 16, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.