diff --git a/edi_sale_ubl_endpoint_oca/README.rst b/edi_sale_ubl_endpoint_oca/README.rst new file mode 100644 index 0000000000..698e1144cc --- /dev/null +++ b/edi_sale_ubl_endpoint_oca/README.rst @@ -0,0 +1,84 @@ +================================== +EDI Sale order import UBL endpoint +================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:54bc6d47a91a1eb84fd38e91f6fbf89ed1e0af414f2cd7c91fbe609ec6af0757 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-lightgray.png?logo=github + :target: https://github.com/OCA/edi/tree/14.0/edi_sale_ubl_endpoint_oca + :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-edi_sale_ubl_endpoint_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&target_branch=14.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Provide default endpoint for importing sale orders. + +This module is more an example on how you can create your own endpoint +to manage such exchanges. + +.. 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 +~~~~~~~~~~~~ + +* thienvh + +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. + +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/edi_sale_ubl_endpoint_oca/__init__.py b/edi_sale_ubl_endpoint_oca/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/edi_sale_ubl_endpoint_oca/__manifest__.py b/edi_sale_ubl_endpoint_oca/__manifest__.py new file mode 100644 index 0000000000..4ea7904f62 --- /dev/null +++ b/edi_sale_ubl_endpoint_oca/__manifest__.py @@ -0,0 +1,15 @@ +# Copyright 2024 Camptocamp +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +{ + "name": "EDI Sale order import UBL endpoint", + "summary": """ + Provide a default endpoint to import SO in UBL format. + """, + "version": "14.0.1.0.0", + "development_status": "Alpha", + "license": "AGPL-3", + "website": "https://github.com/OCA/edi", + "author": "Camptocamp,Odoo Community Association (OCA)", + "depends": ["edi_sale_ubl_oca", "edi_endpoint_oca"], + "data": ["data/endpoint.xml"], +} diff --git a/edi_sale_ubl_endpoint_oca/data/endpoint.xml b/edi_sale_ubl_endpoint_oca/data/endpoint.xml new file mode 100644 index 0000000000..19b260efb2 --- /dev/null +++ b/edi_sale_ubl_endpoint_oca/data/endpoint.xml @@ -0,0 +1,38 @@ + + + + + + + + UBL import SO + /edi/ubl/input/sale_order + POST + application/xml + code + +xml_data = request.httprequest.get_data() +parsed, error = env["sale.order.import"]._parse_xml(xml_data) +if error: + raise werkzeug.exceptions.BadRequest(error) + +exchange_record = endpoint.create_exchange_record( + file_content=xml_data, + edi_exchange_state="input_received" +) + +result = { + "payload": { + "ok": True, + "message": "Your order will be processed shortly", + "data": { + "REF": exchange_record.identifier, + } + } +} + + + + diff --git a/edi_sale_ubl_endpoint_oca/readme/CONTRIBUTORS.rst b/edi_sale_ubl_endpoint_oca/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..d2d7895d53 --- /dev/null +++ b/edi_sale_ubl_endpoint_oca/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* thienvh diff --git a/edi_sale_ubl_endpoint_oca/readme/DESCRIPTION.rst b/edi_sale_ubl_endpoint_oca/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..8c0ef5ec6f --- /dev/null +++ b/edi_sale_ubl_endpoint_oca/readme/DESCRIPTION.rst @@ -0,0 +1,4 @@ +Provide default endpoint for importing sale orders. + +This module is more an example on how you can create your own endpoint +to manage such exchanges. diff --git a/edi_sale_ubl_endpoint_oca/static/description/index.html b/edi_sale_ubl_endpoint_oca/static/description/index.html new file mode 100644 index 0000000000..cae3f57aca --- /dev/null +++ b/edi_sale_ubl_endpoint_oca/static/description/index.html @@ -0,0 +1,428 @@ + + + + + +EDI Sale order import UBL endpoint + + + +
+

EDI Sale order import UBL endpoint

+ + +

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

+

Provide default endpoint for importing sale orders.

+

This module is more an example on how you can create your own endpoint +to manage such exchanges.

+
+

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.

+

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/setup/edi_sale_ubl_endpoint_oca/odoo/addons/edi_sale_ubl_endpoint_oca b/setup/edi_sale_ubl_endpoint_oca/odoo/addons/edi_sale_ubl_endpoint_oca new file mode 120000 index 0000000000..16ee72bda0 --- /dev/null +++ b/setup/edi_sale_ubl_endpoint_oca/odoo/addons/edi_sale_ubl_endpoint_oca @@ -0,0 +1 @@ +../../../../edi_sale_ubl_endpoint_oca \ No newline at end of file diff --git a/setup/edi_sale_ubl_endpoint_oca/setup.py b/setup/edi_sale_ubl_endpoint_oca/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/edi_sale_ubl_endpoint_oca/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)