Skip to content

[19.0][MIG] report_py3o: Migration to 19.0#1132

Open
kopeyev wants to merge 153 commits intoOCA:19.0from
kopeyev:19.0-mig-report_py3o
Open

[19.0][MIG] report_py3o: Migration to 19.0#1132
kopeyev wants to merge 153 commits intoOCA:19.0from
kopeyev:19.0-mig-report_py3o

Conversation

@kopeyev
Copy link

@kopeyev kopeyev commented Feb 11, 2026

No description provided.

lmignon and others added 30 commits February 11, 2026 18:39
Replace README.md by README.rst (not finished)
Remove <data> in views
Protect import of py3o libs
Remove dep on base module
Other small changes
Rename __openerp__.py to __manifest__.py
@kopeyev kopeyev force-pushed the 19.0-mig-report_py3o branch 20 times, most recently from d72b1dd to af7e4f6 Compare February 13, 2026 02:50
Copy link
Contributor

@glitchov glitchov left a comment

Choose a reason for hiding this comment

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

How do you deal with the [report_py3o] section of the Odoo conf file which contains the root_tmpl_path key ?
Shouldn't you have something like this ?https://github.com/OCA/queue/blob/d2a8e902eef111cee495e96bd8bc903155ba29ae/queue_job/jobrunner/__init__.py#L13

@em230418
Copy link
Contributor

em230418 commented Feb 16, 2026

How do you deal with the [report_py3o] section of the Odoo conf file which contains the root_tmpl_path key ?
Shouldn't you have something like this ?

Hi, @glitchov!
Me and @kopeyev did not understand what you mean. Could you explain please?

Nevermind, understood

"""Check if the path is a trusted path for py3o templates."""
real_path = os.path.realpath(path)
root_path = tools.config.get_misc("report_py3o", "root_tmpl_path")
root_path = tools.config.get("root_tmpl_path")
Copy link
Contributor

Choose a reason for hiding this comment

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

Почему убрал? Должен читать секцию report_py3o и данные оттуда

Copy link
Author

Choose a reason for hiding this comment

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

в 19.0 убрали misc/get_misc, поэтому заменил на tools.config.get("root_tmpl_path")

Copy link
Contributor

Choose a reason for hiding this comment

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

I've also seen that get_misc was removed but there is no automatic mechanism to get the report_py3o section in tools.config. So apart from the tests where you 'artificially' put root_tmpl_path directly into tools.config it won't work.

from odoo.tests.common import TransactionCase

from odoo.addons.base.tests.test_mimetypes import PNG
from odoo.addons.base.tests.test_mimetypes import PNG as ODOO_PNG
Copy link
Contributor

Choose a reason for hiding this comment

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

В чем смысл брать переменную под другим названием?

Copy link
Author

Choose a reason for hiding this comment

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

вернул как было

Comment on lines 29 to 31
from ..models._py3o_parser_context import format_multiline_value
from ..models.ir_actions_report import PY3O_CONVERSION_COMMAND_PARAMETER
from ..models.py3o_report import TemplateNotFound
from ..wizard._py3o_parser_context import format_multiline_value
from ..wizard.py3o_report import Py3oReport, TemplateNotFound
Copy link
Contributor

Choose a reason for hiding this comment

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

Зачем в предыдущем коммите перенес _py3o_parser_context и py3o_report?

Copy link
Author

Choose a reason for hiding this comment

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

для pre-commit

Comment on lines 94 to 104
users = self.env["res.users"].search([], limit=2)
if len(users) < 2:
users |= self.env["res.users"].create(
{
"name": "Test User 2",
"login": f"test_user_2_{self.env.cr.dbname}",
"email": f"test_user_2_{self.env.cr.dbname}@example.com",
}
)
users.write({"image_1920": ODOO_PNG})
self.assertGreaterEqual(len(users), 2)
Copy link
Contributor

Choose a reason for hiding this comment

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

Зачем пользователей создавать?

Copy link
Author

@kopeyev kopeyev Feb 17, 2026

Choose a reason for hiding this comment

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

нужно >= 2 записи, иначе _zip_results не вызывается -> patched_zip_results.call_count = 0 и тест падает:

2026-02-17 07:26:05,576 3034 ERROR odoo odoo.addons.report_py3o.tests.test_report_py3o: FAIL: TestReportPy3o.test_reports_merge_zip
Traceback (most recent call last):
File "/__w/reporting-engine/reporting-engine/report_py3o/tests/test_report_py3o.py", line 103, in test_reports_merge_zip
self.assertEqual(1, patched_zip_results.call_count)
AssertionError: 1 != 0

@kopeyev kopeyev force-pushed the 19.0-mig-report_py3o branch 4 times, most recently from 21a952a to 92af02a Compare February 17, 2026 08:53
@kopeyev kopeyev force-pushed the 19.0-mig-report_py3o branch from 92af02a to 62ca952 Compare February 17, 2026 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Comments