From cc5f946b8cf061790d6c51729fc087224c5ad608 Mon Sep 17 00:00:00 2001 From: duongtq Date: Tue, 12 Sep 2023 10:35:49 +0700 Subject: [PATCH] [MIG] base_edifact: Migration to 16.0 --- base_edifact/README.rst | 24 +++++++++++++--------- base_edifact/__manifest__.py | 4 +--- base_edifact/models/edifact.py | 11 +--------- base_edifact/readme/CONTRIBUTORS.rst | 1 + base_edifact/static/description/index.html | 11 ++++++---- base_edifact/tests/test_base_edifact.py | 12 +---------- requirements.txt | 1 + 7 files changed, 26 insertions(+), 38 deletions(-) diff --git a/base_edifact/README.rst b/base_edifact/README.rst index 001bc5773a..dbbe9de281 100644 --- a/base_edifact/README.rst +++ b/base_edifact/README.rst @@ -2,10 +2,13 @@ Base EDIFACT ============ -.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:46f460bfd63a119ad37043be4722116e1cf9743240815eed79ed860de56364fa + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png :target: https://odoo-community.org/page/development-status @@ -14,16 +17,16 @@ Base EDIFACT :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fedi-lightgray.png?logo=github - :target: https://github.com/OCA/edi/tree/14.0/base_edifact + :target: https://github.com/OCA/edi/tree/16.0/base_edifact :alt: OCA/edi .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/edi-14-0/edi-14-0-base_edifact + :target: https://translation.odoo-community.org/projects/edi-16-0/edi-16-0-base_edifact :alt: Translate me on Weblate -.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/226/14.0 - :alt: Try me on Runbot +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/edi&target_branch=16.0 + :alt: Try me on Runboat -|badge1| |badge2| |badge3| |badge4| |badge5| +|badge1| |badge2| |badge3| |badge4| |badge5| This module contains methods to generate and parse EDIFACT/D96A files @@ -81,8 +84,8 @@ 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 smashing it by providing a detailed and welcomed -`feedback `_. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -100,6 +103,7 @@ Contributors * Rafa Morant (www.albasoft.com) * Marc Poch +* Duong (Tran Quoc) Maintainers ~~~~~~~~~~~ @@ -122,6 +126,6 @@ Current `maintainer `__: |maintainer-rmorant| -This module is part of the `OCA/edi `_ project on GitHub. +This module is part of the `OCA/edi `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/base_edifact/__manifest__.py b/base_edifact/__manifest__.py index 04b684a759..ed11e257dc 100644 --- a/base_edifact/__manifest__.py +++ b/base_edifact/__manifest__.py @@ -1,10 +1,9 @@ # Copyright 2023 ALBA Software S.L. # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3.0) - { "name": "Base EDIFACT", "summary": "UN/EDIFACT/D96A utilities using pydifact parser", - "version": "14.0.1.0.0", + "version": "16.0.1.0.0", "development_status": "Alpha", "category": "Tools", "website": "https://github.com/OCA/edi", @@ -19,7 +18,6 @@ "bin": [], }, "depends": [ - "edi_party_data_oca", # for configuration "account", "partner_identification", diff --git a/base_edifact/models/edifact.py b/base_edifact/models/edifact.py index 76c17b0bee..8dbfd0aaf7 100644 --- a/base_edifact/models/edifact.py +++ b/base_edifact/models/edifact.py @@ -4,9 +4,7 @@ from pydifact.segmentcollection import Interchange, Message from pydifact.segments import Segment -from odoo import _, api, exceptions, models - -from odoo.addons.edi_party_data_oca.utils import get_party_data_component +from odoo import api, models logger = logging.getLogger(__name__) @@ -66,13 +64,6 @@ def pydifact_obj(self, docu): obj.append(msg) return obj - @api.model - def get_party_data(self, exchange_record, partner, raise_if_not_found=True): - provider = get_party_data_component(exchange_record, partner) - if not provider and raise_if_not_found: - raise exceptions.UserError(_("No info provider found for party data")) - return provider.get_party() if provider else None - @api.model def _loads_edifact(self, order_file): interchange = Interchange.from_str(order_file.decode()) diff --git a/base_edifact/readme/CONTRIBUTORS.rst b/base_edifact/readme/CONTRIBUTORS.rst index 4dbcae9a88..a7a744310a 100644 --- a/base_edifact/readme/CONTRIBUTORS.rst +++ b/base_edifact/readme/CONTRIBUTORS.rst @@ -1,2 +1,3 @@ * Rafa Morant (www.albasoft.com) * Marc Poch +* Duong (Tran Quoc) diff --git a/base_edifact/static/description/index.html b/base_edifact/static/description/index.html index 4c92997f2b..d19f9bd12f 100644 --- a/base_edifact/static/description/index.html +++ b/base_edifact/static/description/index.html @@ -366,8 +366,10 @@

Base EDIFACT

-

Alpha License: AGPL-3 OCA/edi Translate me on Weblate Try me on Runbot

+

Alpha License: AGPL-3 OCA/edi Translate me on Weblate Try me on Runboat

This module contains methods to generate and parse EDIFACT/D96A files

Important

@@ -428,8 +430,8 @@

14.0.1.0.0 (2023-04-13)

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 smashing it by providing a detailed and welcomed -feedback.

+If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

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

@@ -446,6 +448,7 @@

Contributors

@@ -457,7 +460,7 @@

Maintainers

promote its widespread use.

Current maintainer:

rmorant

-

This module is part of the OCA/edi project on GitHub.

+

This module is part of the OCA/edi project on GitHub.

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

diff --git a/base_edifact/tests/test_base_edifact.py b/base_edifact/tests/test_base_edifact.py index b2932da553..fafe8dd490 100644 --- a/base_edifact/tests/test_base_edifact.py +++ b/base_edifact/tests/test_base_edifact.py @@ -16,17 +16,7 @@ class TestBaseEdifact(TransactionCase): @classmethod def setUpClass(cls): super().setUpClass() - - @classmethod - def tearDownClass(cls): - super().tearDownClass() - - def setUp(self): - super().setUp() - self.base_edifact_model = self.env["base.edifact"] - - def tearDown(self): - return super().tearDown() + cls.base_edifact_model = cls.env["base.edifact"] def test_pydifact_obj(self): edifact_docu = _get_file_content("Retail_EDIFACT_ORDERS_sample1.txt") diff --git a/requirements.txt b/requirements.txt index 0c274da96b..6fa5d1b819 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ # generated from manifests external_dependencies factur-x +pydifact