From 15bb251764a737e735eda2d39c7c63ce933541a5 Mon Sep 17 00:00:00 2001
From: victorvermot
Date: Wed, 15 Jan 2025 10:11:34 +0100
Subject: [PATCH] [MIG] edi_exchange_template_oca: Migration to 18.0
---
edi_exchange_template_oca/README.rst | 14 +++++++-------
edi_exchange_template_oca/__manifest__.py | 2 +-
.../components/output_mixin.py | 14 --------------
.../static/description/index.html | 6 +++---
edi_exchange_template_oca/tests/test_nswrapper.py | 9 +++------
edi_exchange_template_oca/utils.py | 10 ++++------
.../views/edi_exchange_template_output_views.xml | 14 +++++++-------
7 files changed, 25 insertions(+), 44 deletions(-)
diff --git a/edi_exchange_template_oca/README.rst b/edi_exchange_template_oca/README.rst
index b009d6370..6d742956a 100644
--- a/edi_exchange_template_oca/README.rst
+++ b/edi_exchange_template_oca/README.rst
@@ -17,13 +17,13 @@ EDI Exchange Template
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fedi--framework-lightgray.png?logo=github
- :target: https://github.com/OCA/edi-framework/tree/17.0/edi_exchange_template_oca
+ :target: https://github.com/OCA/edi-framework/tree/18.0/edi_exchange_template_oca
:alt: OCA/edi-framework
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
- :target: https://translation.odoo-community.org/projects/edi-framework-17-0/edi-framework-17-0-edi_exchange_template_oca
+ :target: https://translation.odoo-community.org/projects/edi-framework-18-0/edi-framework-18-0-edi_exchange_template_oca
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
- :target: https://runboat.odoo-community.org/builds?repo=OCA/edi-framework&target_branch=17.0
+ :target: https://runboat.odoo-community.org/builds?repo=OCA/edi-framework&target_branch=18.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -46,7 +46,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues `_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
-`feedback `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -62,8 +62,8 @@ Authors
Contributors
------------
-- Simone Orsi
-- John Herholz
+- Simone Orsi
+- John Herholz
Maintainers
-----------
@@ -86,6 +86,6 @@ Current `maintainer `__:
|maintainer-simahawk|
-This module is part of the `OCA/edi-framework `_ project on GitHub.
+This module is part of the `OCA/edi-framework `_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/edi_exchange_template_oca/__manifest__.py b/edi_exchange_template_oca/__manifest__.py
index 5e91f34db..b6783d1c1 100644
--- a/edi_exchange_template_oca/__manifest__.py
+++ b/edi_exchange_template_oca/__manifest__.py
@@ -5,7 +5,7 @@
{
"name": "EDI Exchange Template",
"summary": """Allows definition of exchanges via templates.""",
- "version": "17.0.1.0.0",
+ "version": "18.0.1.0.0",
"development_status": "Beta",
"license": "LGPL-3",
"author": "ACSONE,Camptocamp,Odoo Community Association (OCA)",
diff --git a/edi_exchange_template_oca/components/output_mixin.py b/edi_exchange_template_oca/components/output_mixin.py
index 9c675f74a..8c56d22c1 100644
--- a/edi_exchange_template_oca/components/output_mixin.py
+++ b/edi_exchange_template_oca/components/output_mixin.py
@@ -4,7 +4,6 @@
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
import datetime
-import logging
import pytz
@@ -12,8 +11,6 @@
from odoo.addons.component.core import AbstractComponent
-_logger = logging.getLogger(__name__)
-
class EDIExchangeInfoOutputMixin(AbstractComponent):
"""Abstract component mixin to generate info for output templates."""
@@ -44,14 +41,3 @@ def date_to_string(dt, utc=True):
if utc:
dt = dt.astimezone(pytz.UTC)
return fields.Date.to_string(dt)
-
-
-class EDIExchangeInfoOutputMixinDeprecated(AbstractComponent):
- _name = "edi.output.mixin"
- _inherit = "edi.info.output.mixin"
-
- def __init__(self, work_context):
- super().__init__(work_context)
- _logger.warning(
- "`%s` is deprecated, use `edi.info.output.mixin` as mixin.", self._name
- )
diff --git a/edi_exchange_template_oca/static/description/index.html b/edi_exchange_template_oca/static/description/index.html
index ef8d66f36..109e4b401 100644
--- a/edi_exchange_template_oca/static/description/index.html
+++ b/edi_exchange_template_oca/static/description/index.html
@@ -369,7 +369,7 @@ EDI Exchange Template
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:f53c2d65c268e102166f3618c7e9ae820d1e703d7ab3a167657cb3b7f2613d03
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-
![Try me on Runboat](https://img.shields.io/badge/runboat-Try%20me-875A7B.png)
+
![Try me on Runboat](https://img.shields.io/badge/runboat-Try%20me-875A7B.png)
Provide EDI exchange templates to control input/output records contents.
Provides following models:
@@ -393,7 +393,7 @@
Bugs are tracked on GitHub Issues.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
-feedback.
+feedback.
Do not contact contributors directly about support or help with technical issues.
diff --git a/edi_exchange_template_oca/tests/test_nswrapper.py b/edi_exchange_template_oca/tests/test_nswrapper.py
index 2bcc0f387..23fc63ecf 100644
--- a/edi_exchange_template_oca/tests/test_nswrapper.py
+++ b/edi_exchange_template_oca/tests/test_nswrapper.py
@@ -2,7 +2,6 @@
# @author Simone Orsi
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from odoo.tests.common import TransactionCase
-from odoo.tools import pycompat
from ..utils import xml_purge_nswrapper
@@ -43,16 +42,14 @@
class TestNSWrapper(TransactionCase):
- maxDiff = None
-
def test_purge1(self):
res = xml_purge_nswrapper(XML1)
- self.assertNotIn("nswrapper", pycompat.to_text(res))
+ self.assertNotIn("nswrapper", str(res))
def test_purge2(self):
res = xml_purge_nswrapper(XML2)
- self.assertNotIn("nswrapper", pycompat.to_text(res))
+ self.assertNotIn("nswrapper", str(res))
def test_purge3(self):
res = xml_purge_nswrapper(ORDER_RESP_WRAPPER_TMPL.format(XML2))
- self.assertNotIn("nswrapper", pycompat.to_text(res))
+ self.assertNotIn("nswrapper", str(res))
diff --git a/edi_exchange_template_oca/utils.py b/edi_exchange_template_oca/utils.py
index e9ebf244f..cc6e8454b 100644
--- a/edi_exchange_template_oca/utils.py
+++ b/edi_exchange_template_oca/utils.py
@@ -5,8 +5,6 @@
from lxml import etree
-from odoo.tools import pycompat
-
def xml_purge_nswrapper(xml_content):
"""Purge `nswrapper` elements.
@@ -36,10 +34,10 @@ def xml_purge_nswrapper(xml_content):
parent = nswrapper.getparent()
if parent is None:
# fmt:off
- return "".join([
- pycompat.to_text(etree.tostring(el))
- for el in nswrapper.getchildren()
- ])
+ return "".join(
+ [etree.tostring(child, encoding="unicode")
+ for child in nswrapper.getchildren()]
+ )
# fmt:on
parent.extend(nswrapper.getchildren())
parent.remove(nswrapper)
diff --git a/edi_exchange_template_oca/views/edi_exchange_template_output_views.xml b/edi_exchange_template_oca/views/edi_exchange_template_output_views.xml
index 3a9f771e2..9c119995e 100644
--- a/edi_exchange_template_oca/views/edi_exchange_template_output_views.xml
+++ b/edi_exchange_template_oca/views/edi_exchange_template_output_views.xml
@@ -1,15 +1,15 @@
-
+
edi.exchange.template.output
-
+
-
+
@@ -106,7 +106,7 @@
EDI Exchange Template Output
ir.actions.act_window
edi.exchange.template.output
- tree,form
+ list,form
[]
{}
@@ -122,12 +122,12 @@
- tree
-
+ list
+