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][IMP] upgrade_analysis: don't depend on mako #3170

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# generated from manifests external_dependencies
astor
dataclasses
mako
odoorpc
openupgradelib
2 changes: 1 addition & 1 deletion upgrade_analysis/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"installable": True,
"depends": ["base"],
"external_dependencies": {
"python": ["mako", "dataclasses", "odoorpc", "openupgradelib"],
"python": ["dataclasses", "odoorpc", "openupgradelib"],
},
"license": "AGPL-3",
}
21 changes: 7 additions & 14 deletions upgrade_analysis/models/upgrade_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from copy import deepcopy

from lxml import etree
from mako.template import Template

from odoo import fields, models, release
from odoo.exceptions import ValidationError
Expand Down Expand Up @@ -519,15 +518,6 @@
if not module_coverage_file_folder:
return

file_template = Template(
filename=os.path.join(
get_module_path("upgrade_analysis"),
"static",
"src",
"module_coverage_template.rst.mako",
)
)

module_domain = [
("state", "=", "installed"),
(
Expand Down Expand Up @@ -587,10 +577,13 @@
49, " "
)

rendered_text = file_template.render(
start_version=start_version,
end_version=end_version,
module_descriptions=module_descriptions,
rendered_text = self.env["ir.qweb"]._render(

Check warning on line 580 in upgrade_analysis/models/upgrade_analysis.py

View check run for this annotation

Codecov / codecov/patch

upgrade_analysis/models/upgrade_analysis.py#L580

Added line #L580 was not covered by tests
"upgrade_analysis.module_coverage",
values=dict(
start_version=start_version,
end_version=end_version,
module_descriptions=module_descriptions,
),
)

file_name = "modules{}-{}.rst".format(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
Module coverage ${start_version} -> ${end_version}
<odoo>
<template id="module_coverage">Module coverage <t t-out="start_version" /> -> <t
t-out="end_version"
/>
============================

.. include:: coverage_legend.rst

+---------------------------------------------------+----------------------+-------------------------------------------------+
| Module | Status + Extra Information |
+===================================================+======================+=================================================+
% for module, extra_information in module_descriptions.items():
|${module}| |${extra_information}|
<t t-foreach="module_descriptions" t-as="module">
|<t t-out="module" />| |<t t-out="module_value" />|
+---------------------------------------------------+----------------------+-------------------------------------------------+
% endfor
</t>
</template>
</odoo>
Loading