# HG changeset patch # User Vincent Hatakeyama <vincent.hatakeyama@xcg-consulting.fr> # Date 1739977613 -3600 # Wed Feb 19 16:06:53 2025 +0100 # Branch 18.0 # Node ID a1a7bf16e7d6a563fe9b68f354084ec03918b703 # Parent ce2e110feb9e72185afcab309a727fca197feb7e ✨ Compatibility with changes in converter 18.0.4.0.0 diff --git a/NEWS.rst b/NEWS.rst --- a/NEWS.rst +++ b/NEWS.rst @@ -2,6 +2,11 @@ Changelog ========= +18.0.1.4.0 +---------- + +Compatibility with changes in converter 18.0.4.0.0. + 18.0.1.3.0 ---------- diff --git a/__manifest__.py b/__manifest__.py --- a/__manifest__.py +++ b/__manifest__.py @@ -1,7 +1,7 @@ ############################################################################## # # Redner Odoo module -# Copyright © 2016, 2023, 2024 XCG Consulting <https://xcg-consulting.fr> +# Copyright © 2016, 2023-2025 XCG Consulting <https://xcg-consulting.fr> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -21,7 +21,7 @@ { "name": "Redner", "license": "AGPL-3", - "version": "18.0.1.3.0", + "version": "18.0.1.4.0", "category": "Reporting", "author": "XCG Consulting", "website": "https://orbeet.io/", diff --git a/models/redner_substitution.py b/models/redner_substitution.py --- a/models/redner_substitution.py +++ b/models/redner_substitution.py @@ -1,7 +1,7 @@ ############################################################################## # # Redner Odoo module -# Copyright © 2016 XCG Consulting <https://xcg-consulting.fr> +# Copyright © 2016, 2025 XCG Consulting <https://xcg-consulting.fr> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -19,7 +19,7 @@ ############################################################################## from odoo import _, api, fields, models # type: ignore[import-untyped] -from odoo.addons import converter # type: ignore[import-untyped] +from odoo.addons import converter from odoo.exceptions import ValidationError # type: ignore[import-untyped] from ..converter import ImageDataURL, ImageFile @@ -186,4 +186,4 @@ raise ValidationError(_("invalid converter type: %s") % sub.converter) d[sub.keyword.rsplit(".", 2)[-1]] = conv - return converter.Model("", d) + return converter.Model(d) diff --git a/pyproject.toml b/pyproject.toml --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ ] dependencies = [ "odoo==18.0.*", - "odoo-addon-converter >=18.0.1,<18.0.4", + "odoo-addon-converter >=18.0.4,<18.0.5", "requests_unixsocket", ] diff --git a/tests/test_ir_actions_report.py b/tests/test_ir_actions_report.py --- a/tests/test_ir_actions_report.py +++ b/tests/test_ir_actions_report.py @@ -76,7 +76,7 @@ "https://test-redner-url/api/v1/render", json={ "accept": "text/html", - "data": [{"__type__": "", "login": "demo"}], + "data": [{"login": "demo"}], "template": { "account": "test-account", "name": "test-redner-id", diff --git a/tests/test_mail_template.py b/tests/test_mail_template.py --- a/tests/test_mail_template.py +++ b/tests/test_mail_template.py @@ -73,7 +73,7 @@ "https://test-redner-url/api/v1/render", json={ "accept": "text/html", - "data": [{"__type__": "", "login": "demo"}], + "data": [{"login": "demo"}], "template": { "account": "test-account", "name": "test-redner-id", # HG changeset patch # User Vincent Hatakeyama <vincent.hatakeyama@xcg-consulting.fr> # Date 1739978381 -3600 # Wed Feb 19 16:19:41 2025 +0100 # Branch 18.0 # Node ID 45782562e45bfe61ade010f60024606eb38c93dc # Parent a1a7bf16e7d6a563fe9b68f354084ec03918b703 👕 mypy diff --git a/converter.py b/converter.py --- a/converter.py +++ b/converter.py @@ -23,7 +23,7 @@ from typing import Any from odoo import models # type: ignore[import-untyped] -from odoo.addons.converter import Converter # type: ignore[import-untyped] +from odoo.addons.converter import Converter from odoo.tools.mimetypes import guess_mimetype # type: ignore[import-untyped] diff --git a/doc/autotodo.py b/doc/autotodo.py --- a/doc/autotodo.py +++ b/doc/autotodo.py @@ -22,7 +22,7 @@ import os import os.path import sys -from collections.abc import Mapping +from collections.abc import MutableMapping def main(): @@ -31,17 +31,17 @@ sys.exit(1) folder = sys.argv[1] - exts = sys.argv[2].split(",") - tags = sys.argv[3].split(",") - todolist = {tag: [] for tag in tags} - path_file_length: Mapping[str, int] = {} + exts: list[str] = sys.argv[2].split(",") + tags: list[str] = sys.argv[3].split(",") + todolist: dict[str, list[tuple[str, int, str]]] = {tag: [] for tag in tags} + path_file_length: MutableMapping[str, int] = {} for root, _dirs, files in os.walk(folder): scan_folder((exts, tags, todolist, path_file_length), root, files) create_autotodo(folder, todolist, path_file_length) -def write_info(f, infos, folder, path_file_length: Mapping[str, int]): +def write_info(f, infos, folder, path_file_length: MutableMapping[str, int]): # Check sphinx version for lineno-start support import sphinx @@ -78,14 +78,23 @@ f.write("\n") -def create_autotodo(folder, todolist, path_file_length: Mapping[str, int]): +def create_autotodo(folder, todolist, path_file_length: MutableMapping[str, int]): with open("autotodo", "w+") as f: for tag, info in list(todolist.items()): f.write("{}\n{}\n\n".format(tag, "=" * len(tag))) write_info(f, info, folder, path_file_length) -def scan_folder(data_tuple, dirname, names): +def scan_folder( + data_tuple: tuple[ + list[str], + list[str], + dict[str, list[tuple[str, int, str]]], + MutableMapping[str, int], + ], + dirname: str, + names: list[str], +): (exts, tags, res, path_file_length) = data_tuple for name in names: (root, ext) = os.path.splitext(name) @@ -98,7 +107,9 @@ res[tag].extend(info) -def scan_file(filename, tags) -> tuple[dict[str, list[tuple[str, int, str]]], int]: +def scan_file( + filename: str, tags: list[str] +) -> tuple[dict[str, list[tuple[str, int, str]]], int]: res: dict[str, list[tuple[str, int, str]]] = {tag: [] for tag in tags} line_num: int = 0 with open(filename) as f: diff --git a/redner.py b/redner.py --- a/redner.py +++ b/redner.py @@ -23,7 +23,7 @@ from urllib.parse import quote import requests -import requests_unixsocket +import requests_unixsocket # type: ignore[import-untyped] from odoo import _ # type: ignore[import-untyped] from odoo.exceptions import ValidationError # type: ignore[import-untyped]