Skip to content

Commit 459fab5

Browse files
committed
[MIG] edi_exchange_template_oca: Migration to 18.0
1 parent 488ee06 commit 459fab5

File tree

7 files changed

+25
-45
lines changed

7 files changed

+25
-45
lines changed

edi_exchange_template_oca/README.rst

+7-7
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ EDI Exchange Template
1717
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
1818
:alt: License: LGPL-3
1919
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fedi--framework-lightgray.png?logo=github
20-
:target: https://github.com/OCA/edi-framework/tree/17.0/edi_exchange_template_oca
20+
:target: https://github.com/OCA/edi-framework/tree/18.0/edi_exchange_template_oca
2121
:alt: OCA/edi-framework
2222
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23-
:target: https://translation.odoo-community.org/projects/edi-framework-17-0/edi-framework-17-0-edi_exchange_template_oca
23+
:target: https://translation.odoo-community.org/projects/edi-framework-18-0/edi-framework-18-0-edi_exchange_template_oca
2424
:alt: Translate me on Weblate
2525
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26-
:target: https://runboat.odoo-community.org/builds?repo=OCA/edi-framework&target_branch=17.0
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/edi-framework&target_branch=18.0
2727
:alt: Try me on Runboat
2828

2929
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -46,7 +46,7 @@ Bug Tracker
4646
Bugs are tracked on `GitHub Issues <https://github.com/OCA/edi-framework/issues>`_.
4747
In case of trouble, please check there if your issue has already been reported.
4848
If you spotted it first, help us to smash it by providing a detailed and welcomed
49-
`feedback <https://github.com/OCA/edi-framework/issues/new?body=module:%20edi_exchange_template_oca%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
49+
`feedback <https://github.com/OCA/edi-framework/issues/new?body=module:%20edi_exchange_template_oca%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
5050

5151
Do not contact contributors directly about support or help with technical issues.
5252

@@ -62,8 +62,8 @@ Authors
6262
Contributors
6363
------------
6464

65-
- Simone Orsi <[email protected]>
66-
- John Herholz <[email protected]>
65+
- Simone Orsi <[email protected]>
66+
- John Herholz <[email protected]>
6767

6868
Maintainers
6969
-----------
@@ -86,6 +86,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
8686

8787
|maintainer-simahawk|
8888

89-
This module is part of the `OCA/edi-framework <https://github.com/OCA/edi-framework/tree/17.0/edi_exchange_template_oca>`_ project on GitHub.
89+
This module is part of the `OCA/edi-framework <https://github.com/OCA/edi-framework/tree/18.0/edi_exchange_template_oca>`_ project on GitHub.
9090

9191
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

edi_exchange_template_oca/__manifest__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{
66
"name": "EDI Exchange Template",
77
"summary": """Allows definition of exchanges via templates.""",
8-
"version": "17.0.1.0.0",
8+
"version": "18.0.1.0.0",
99
"development_status": "Beta",
1010
"license": "LGPL-3",
1111
"author": "ACSONE,Camptocamp,Odoo Community Association (OCA)",

edi_exchange_template_oca/components/output_mixin.py

-15
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,12 @@
44
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
55

66
import datetime
7-
import logging
8-
97
import pytz
108

119
from odoo import fields
1210

1311
from odoo.addons.component.core import AbstractComponent
1412

15-
_logger = logging.getLogger(__name__)
16-
1713

1814
class EDIExchangeInfoOutputMixin(AbstractComponent):
1915
"""Abstract component mixin to generate info for output templates."""
@@ -44,14 +40,3 @@ def date_to_string(dt, utc=True):
4440
if utc:
4541
dt = dt.astimezone(pytz.UTC)
4642
return fields.Date.to_string(dt)
47-
48-
49-
class EDIExchangeInfoOutputMixinDeprecated(AbstractComponent):
50-
_name = "edi.output.mixin"
51-
_inherit = "edi.info.output.mixin"
52-
53-
def __init__(self, work_context):
54-
super().__init__(work_context)
55-
_logger.warning(
56-
"`%s` is deprecated, use `edi.info.output.mixin` as mixin.", self._name
57-
)

edi_exchange_template_oca/static/description/index.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ <h1 class="title">EDI Exchange Template</h1>
369369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370370
!! source digest: sha256:f53c2d65c268e102166f3618c7e9ae820d1e703d7ab3a167657cb3b7f2613d03
371371
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372-
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/edi-framework/tree/17.0/edi_exchange_template_oca"><img alt="OCA/edi-framework" src="https://img.shields.io/badge/github-OCA%2Fedi--framework-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/edi-framework-17-0/edi-framework-17-0-edi_exchange_template_oca"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/edi-framework&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
372+
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/edi-framework/tree/18.0/edi_exchange_template_oca"><img alt="OCA/edi-framework" src="https://img.shields.io/badge/github-OCA%2Fedi--framework-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/edi-framework-18-0/edi-framework-18-0-edi_exchange_template_oca"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/edi-framework&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373373
<p>Provide EDI exchange templates to control input/output records contents.</p>
374374
<p>Provides following models:</p>
375375
<ol class="arabic simple">
@@ -393,7 +393,7 @@ <h1><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h1>
393393
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/edi-framework/issues">GitHub Issues</a>.
394394
In case of trouble, please check there if your issue has already been reported.
395395
If you spotted it first, help us to smash it by providing a detailed and welcomed
396-
<a class="reference external" href="https://github.com/OCA/edi-framework/issues/new?body=module:%20edi_exchange_template_oca%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
396+
<a class="reference external" href="https://github.com/OCA/edi-framework/issues/new?body=module:%20edi_exchange_template_oca%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
397397
<p>Do not contact contributors directly about support or help with technical issues.</p>
398398
</div>
399399
<div class="section" id="credits">
@@ -423,7 +423,7 @@ <h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2>
423423
promote its widespread use.</p>
424424
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
425425
<p><a class="reference external image-reference" href="https://github.com/simahawk"><img alt="simahawk" src="https://github.com/simahawk.png?size=40px" /></a></p>
426-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/edi-framework/tree/17.0/edi_exchange_template_oca">OCA/edi-framework</a> project on GitHub.</p>
426+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/edi-framework/tree/18.0/edi_exchange_template_oca">OCA/edi-framework</a> project on GitHub.</p>
427427
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
428428
</div>
429429
</div>

edi_exchange_template_oca/tests/test_nswrapper.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# @author Simone Orsi <[email protected]>
33
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
44
from odoo.tests.common import TransactionCase
5-
from odoo.tools import pycompat
65

76
from ..utils import xml_purge_nswrapper
87

@@ -43,16 +42,14 @@
4342

4443

4544
class TestNSWrapper(TransactionCase):
46-
maxDiff = None
47-
4845
def test_purge1(self):
4946
res = xml_purge_nswrapper(XML1)
50-
self.assertNotIn("nswrapper", pycompat.to_text(res))
47+
self.assertNotIn("nswrapper", str(res))
5148

5249
def test_purge2(self):
5350
res = xml_purge_nswrapper(XML2)
54-
self.assertNotIn("nswrapper", pycompat.to_text(res))
51+
self.assertNotIn("nswrapper", str(res))
5552

5653
def test_purge3(self):
5754
res = xml_purge_nswrapper(ORDER_RESP_WRAPPER_TMPL.format(XML2))
58-
self.assertNotIn("nswrapper", pycompat.to_text(res))
55+
self.assertNotIn("nswrapper", str(res))

edi_exchange_template_oca/utils.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55

66
from lxml import etree
77

8-
from odoo.tools import pycompat
9-
108

119
def xml_purge_nswrapper(xml_content):
1210
"""Purge `nswrapper` elements.
@@ -36,10 +34,10 @@ def xml_purge_nswrapper(xml_content):
3634
parent = nswrapper.getparent()
3735
if parent is None:
3836
# fmt:off
39-
return "".join([
40-
pycompat.to_text(etree.tostring(el))
41-
for el in nswrapper.getchildren()
42-
])
37+
return "".join(
38+
[etree.tostring(child, encoding="unicode")
39+
for child in nswrapper.getchildren()]
40+
)
4341
# fmt:on
4442
parent.extend(nswrapper.getchildren())
4543
parent.remove(nswrapper)

edi_exchange_template_oca/views/edi_exchange_template_output_views.xml

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<?xml version="1.0" encoding="UTF-8" ?>
22
<odoo>
3-
<record id="edi_exchange_template_output_view_tree" model="ir.ui.view">
3+
<record id="edi_exchange_template_output_view_list" model="ir.ui.view">
44
<field name="model">edi.exchange.template.output</field>
55
<field name="arch" type="xml">
6-
<tree>
6+
<list>
77
<field name="backend_type_id" />
88
<field name="backend_id" />
99
<field name="name" />
1010
<field name="code" />
1111
<field name="output_type" />
12-
</tree>
12+
</list>
1313
</field>
1414
</record>
1515
<record id="edi_exchange_template_output_view_form" model="ir.ui.view">
@@ -106,7 +106,7 @@
106106
<field name="name">EDI Exchange Template Output</field>
107107
<field name="type">ir.actions.act_window</field>
108108
<field name="res_model">edi.exchange.template.output</field>
109-
<field name="view_mode">tree,form</field>
109+
<field name="view_mode">list,form</field>
110110
<field name="search_view_id" ref="edi_exchange_template_output_view_search" />
111111
<field name="domain">[]</field>
112112
<field name="context">{}</field>
@@ -122,12 +122,12 @@
122122
</record>
123123
<record
124124
model="ir.actions.act_window.view"
125-
id="act_open_edi_exchange_template_output_view_tree"
125+
id="act_open_edi_exchange_template_output_view_list"
126126
>
127127
<field name="act_window_id" ref="act_open_edi_exchange_template_output_view" />
128128
<field name="sequence" eval="10" />
129-
<field name="view_mode">tree</field>
130-
<field name="view_id" ref="edi_exchange_template_output_view_tree" />
129+
<field name="view_mode">list</field>
130+
<field name="view_id" ref="edi_exchange_template_output_view_list" />
131131
</record>
132132
<menuitem
133133
id="menu_edi_exchange_template_root"

0 commit comments

Comments
 (0)