diff --git a/edi_account_invoice_import_ubl_endpoint_example/README.rst b/edi_account_invoice_import_ubl_endpoint_example/README.rst new file mode 100644 index 000000000..72b09b323 --- /dev/null +++ b/edi_account_invoice_import_ubl_endpoint_example/README.rst @@ -0,0 +1,89 @@ +======================================= +EDI Invoice Import UBL Endpoint Example +======================================= + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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_account_invoice_import_ubl_endpoint_example + :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_account_invoice_import_ubl_endpoint_example + :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 + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Provide default endpoint for importing invoices. + +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 smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* ForgeFlow + +Contributors +~~~~~~~~~~~~ + +* Lois Rilo + +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-LoisRForgeFlow| image:: https://github.com/LoisRForgeFlow.png?size=40px + :target: https://github.com/LoisRForgeFlow + :alt: LoisRForgeFlow + +Current `maintainer `__: + +|maintainer-LoisRForgeFlow| + +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_account_invoice_import_ubl_endpoint_example/__init__.py b/edi_account_invoice_import_ubl_endpoint_example/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/edi_account_invoice_import_ubl_endpoint_example/__manifest__.py b/edi_account_invoice_import_ubl_endpoint_example/__manifest__.py new file mode 100644 index 000000000..e99885ffb --- /dev/null +++ b/edi_account_invoice_import_ubl_endpoint_example/__manifest__.py @@ -0,0 +1,22 @@ +# Copyright 2022 ForgeFlow S.L. (https://www.forgeflow.com) +# @author: Lois Rilo +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "EDI Invoice Import UBL Endpoint Example", + "summary": "Provide a default endpoint to import Invoices in UBL format.", + "version": "16.0.1.0.0", + "development_status": "Alpha", + "license": "AGPL-3", + "website": "https://github.com/OCA/edi", + "author": "ForgeFlow,Odoo Community Association (OCA)", + "maintainers": ["LoisRForgeFlow"], + "depends": [ + "edi_account_invoice_import", + "account_invoice_import_ubl", + "edi_account_invoice_import_ubl", + "edi_endpoint_oca", + ], + "auto_install": False, + "data": ["data/endpoint.xml"], +} diff --git a/edi_account_invoice_import_ubl_endpoint_example/data/endpoint.xml b/edi_account_invoice_import_ubl_endpoint_example/data/endpoint.xml new file mode 100644 index 000000000..c4f7cab46 --- /dev/null +++ b/edi_account_invoice_import_ubl_endpoint_example/data/endpoint.xml @@ -0,0 +1,44 @@ + + + + + + + + + + UBL import Invoice + /edi/ubl/input/account_invoice + POST + application/xml + code + +xml_data = request.httprequest.get_data() +parsed = env["account.invoice.import"].parse_xml_invoice(xml_data) +error = False +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 invoice will be processed shortly", + "data": { + "REF": exchange_record.identifier, + } + } +} + + + + diff --git a/edi_account_invoice_import_ubl_endpoint_example/i18n/edi_sale_order_import_ubl_endpoint.pot b/edi_account_invoice_import_ubl_endpoint_example/i18n/edi_sale_order_import_ubl_endpoint.pot new file mode 100644 index 000000000..4d8b20f91 --- /dev/null +++ b/edi_account_invoice_import_ubl_endpoint_example/i18n/edi_sale_order_import_ubl_endpoint.pot @@ -0,0 +1,13 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" diff --git a/edi_account_invoice_import_ubl_endpoint_example/readme/CONTRIBUTORS.rst b/edi_account_invoice_import_ubl_endpoint_example/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..77dfbe89e --- /dev/null +++ b/edi_account_invoice_import_ubl_endpoint_example/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Lois Rilo diff --git a/edi_account_invoice_import_ubl_endpoint_example/readme/DESCRIPTION.rst b/edi_account_invoice_import_ubl_endpoint_example/readme/DESCRIPTION.rst new file mode 100644 index 000000000..aaa85c8b0 --- /dev/null +++ b/edi_account_invoice_import_ubl_endpoint_example/readme/DESCRIPTION.rst @@ -0,0 +1,4 @@ +Provide default endpoint for importing invoices. + +This module is more an example on how you can create your own endpoint +to manage such exchanges. diff --git a/edi_account_invoice_import_ubl_endpoint_example/static/description/icon.png b/edi_account_invoice_import_ubl_endpoint_example/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/edi_account_invoice_import_ubl_endpoint_example/static/description/icon.png differ diff --git a/edi_account_invoice_import_ubl_endpoint_example/static/description/index.html b/edi_account_invoice_import_ubl_endpoint_example/static/description/index.html new file mode 100644 index 000000000..63b87819c --- /dev/null +++ b/edi_account_invoice_import_ubl_endpoint_example/static/description/index.html @@ -0,0 +1,429 @@ + + + + + + +EDI Invoice Import UBL Endpoint Example + + + +
+

EDI Invoice Import UBL Endpoint Example

+ + +

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

+

Provide default endpoint for importing invoices.

+

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

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • ForgeFlow
  • +
+
+ +
+

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:

+

LoisRForgeFlow

+

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