diff --git a/edi_edifact_oca/README.rst b/edi_edifact_oca/README.rst new file mode 100644 index 000000000..b86775c45 --- /dev/null +++ b/edi_edifact_oca/README.rst @@ -0,0 +1,89 @@ +=========== +EDI EDIFACT +=========== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:1c988857cccb60a4dbc651cab4f8a9b4e4ad12aaa3f89327fb54c1e1268e14bb + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png + :target: https://odoo-community.org/page/development-status + :alt: Alpha +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :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--framework-lightgray.png?logo=github + :target: https://github.com/OCA/edi-framework/tree/16.0/edi_edifact_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-16-0/edi-framework-16-0-edi_edifact_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=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Provide basic configuration for EDIFACT with EDI framework. + +.. IMPORTANT:: + This is an alpha version, the data model and design can change at any time without warning. + Only for development or testing purpose, do not use in production. + `More details on development status `_ + +**Table of contents** + +.. contents:: + :local: + +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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Camptocamp + +Contributors +~~~~~~~~~~~~ + +* Duong (Tran Quoc) + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +.. |maintainer-simahawk| image:: https://github.com/simahawk.png?size=40px + :target: https://github.com/simahawk + :alt: simahawk + +Current `maintainer `__: + +|maintainer-simahawk| + +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_edifact_oca/__init__.py b/edi_edifact_oca/__init__.py new file mode 100644 index 000000000..1377f57f5 --- /dev/null +++ b/edi_edifact_oca/__init__.py @@ -0,0 +1 @@ +from . import components diff --git a/edi_edifact_oca/__manifest__.py b/edi_edifact_oca/__manifest__.py new file mode 100644 index 000000000..9b2c26073 --- /dev/null +++ b/edi_edifact_oca/__manifest__.py @@ -0,0 +1,20 @@ +# Copyright 2023 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +{ + "name": "EDI EDIFACT", + "summary": """Define EDI backend type for EDIFACT.""", + "version": "16.0.1.0.0", + "development_status": "Alpha", + "license": "AGPL-3", + "website": "https://github.com/OCA/edi-framework", + "author": "Camptocamp,Odoo Community Association (OCA)", + "maintainers": ["simahawk"], + "depends": ["edi_oca", "edi_party_data_oca", "base_edifact"], + "auto_install": True, + "data": [ + "data/edi_backend_type.xml", + ], + "demo": [ + "demo/edi_backend_demo.xml", + ], +} diff --git a/edi_edifact_oca/components/__init__.py b/edi_edifact_oca/components/__init__.py new file mode 100644 index 000000000..cb60eac44 --- /dev/null +++ b/edi_edifact_oca/components/__init__.py @@ -0,0 +1 @@ +from . import party_data diff --git a/edi_edifact_oca/components/party_data.py b/edi_edifact_oca/components/party_data.py new file mode 100644 index 000000000..a40289d9b --- /dev/null +++ b/edi_edifact_oca/components/party_data.py @@ -0,0 +1,13 @@ +# Copyright 2023 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.addons.component.core import Component + + +class EDIPartyDataEDIFACT(Component): + """Party data provider specific to EDIFACT.""" + + _name = "edi.party.data.edifact" + _inherit = "edi.party.data" + # TODO @simahawk: is a component per backend type really needed? + _backend_type = "edifact" diff --git a/edi_edifact_oca/data/edi_backend_type.xml b/edi_edifact_oca/data/edi_backend_type.xml new file mode 100644 index 000000000..1c00f2358 --- /dev/null +++ b/edi_edifact_oca/data/edi_backend_type.xml @@ -0,0 +1,7 @@ + + + + EDIFACT + edifact + + diff --git a/edi_edifact_oca/demo/edi_backend_demo.xml b/edi_edifact_oca/demo/edi_backend_demo.xml new file mode 100644 index 000000000..014e6c296 --- /dev/null +++ b/edi_edifact_oca/demo/edi_backend_demo.xml @@ -0,0 +1,7 @@ + + + + EDIFACT backend demo + + + diff --git a/edi_edifact_oca/readme/CONTRIBUTORS.rst b/edi_edifact_oca/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..57c6adf34 --- /dev/null +++ b/edi_edifact_oca/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Duong (Tran Quoc) diff --git a/edi_edifact_oca/readme/DESCRIPTION.rst b/edi_edifact_oca/readme/DESCRIPTION.rst new file mode 100644 index 000000000..d4c8f1485 --- /dev/null +++ b/edi_edifact_oca/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +Provide basic configuration for EDIFACT with EDI framework. diff --git a/edi_edifact_oca/static/description/icon.png b/edi_edifact_oca/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/edi_edifact_oca/static/description/icon.png differ diff --git a/edi_edifact_oca/static/description/index.html b/edi_edifact_oca/static/description/index.html new file mode 100644 index 000000000..ecde9f4c3 --- /dev/null +++ b/edi_edifact_oca/static/description/index.html @@ -0,0 +1,429 @@ + + + + + + +EDI EDIFACT + + + +
+

EDI EDIFACT

+ + +

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

+

Provide basic configuration for EDIFACT with EDI framework.

+
+

Important

+

This is an alpha version, the data model and design can change at any time without warning. +Only for development or testing purpose, do not use in production. +More details on development status

+
+

Table of contents

+ +
+

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.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Camptocamp
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

Current maintainer:

+

simahawk

+

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_edifact_oca/tests/__init__.py b/edi_edifact_oca/tests/__init__.py new file mode 100644 index 000000000..ab479a1db --- /dev/null +++ b/edi_edifact_oca/tests/__init__.py @@ -0,0 +1 @@ +from . import test_party_data diff --git a/edi_edifact_oca/tests/test_party_data.py b/edi_edifact_oca/tests/test_party_data.py new file mode 100644 index 000000000..cd5bf0c0a --- /dev/null +++ b/edi_edifact_oca/tests/test_party_data.py @@ -0,0 +1,30 @@ +# Copyright 2023 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.addons.edi_oca.tests.common import EDIBackendCommonComponentTestCase +from odoo.addons.edi_party_data_oca.utils import get_party_data_component + + +class PartyDataTestCaseEDIFACT(EDIBackendCommonComponentTestCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.backend_edifact = cls.env.ref("edi_edifact_oca.edi_backend_edifact_demo") + cls.backend_no_edifact = cls.env.ref("edi_oca.demo_edi_backend") + cls.exc_type = cls._create_exchange_type( + name="EDIFACT output test", + code="edifact_out_test", + direction="output", + backend_id=cls.backend_edifact.id, + backend_type_id=cls.backend_edifact.backend_type_id.id, + ) + cls.exc_record_edifact = cls.backend_edifact.create_record( + "edifact_out_test", {} + ) + cls.partner = cls.env["res.partner"].create({"name": "EDIFACT Test"}) + + def test_lookup_edifact(self): + provider = get_party_data_component(self.exc_record_edifact, self.partner) + self.assertEqual(provider._name, "edi.party.data.edifact") + self.assertEqual(provider.partner, self.partner) + self.assertFalse(provider.allowed_id_categories) diff --git a/setup/edi_edifact_oca/odoo/addons/edi_edifact_oca b/setup/edi_edifact_oca/odoo/addons/edi_edifact_oca new file mode 120000 index 000000000..191676bee --- /dev/null +++ b/setup/edi_edifact_oca/odoo/addons/edi_edifact_oca @@ -0,0 +1 @@ +../../../../edi_edifact_oca \ No newline at end of file diff --git a/setup/edi_edifact_oca/setup.py b/setup/edi_edifact_oca/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/edi_edifact_oca/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)