diff --git a/edi_endpoint_oca/models/__init__.py b/edi_endpoint_oca/models/__init__.py index 8d770d06a..3d48d48fe 100644 --- a/edi_endpoint_oca/models/__init__.py +++ b/edi_endpoint_oca/models/__init__.py @@ -2,4 +2,3 @@ from . import edi_backend_type from . import edi_endpoint from . import edi_exchange_record -from . import edi_exchange_consumer_mixin diff --git a/edi_partner_endpoint_oca/README.rst b/edi_partner_endpoint_oca/README.rst new file mode 100644 index 000000000..679f38383 --- /dev/null +++ b/edi_partner_endpoint_oca/README.rst @@ -0,0 +1,19 @@ +========================= +EDI Partner Endpoint Glue +========================= + +This module is a glue addon between ``edi_partner_oca`` and ``edi_endpoint_oca``. + +Why it exists +============= + +It was created to fix the registry initialization error: + +:: + + KeyError: 'Field edi_endpoint_id referenced in related field definition + res.partner.origin_edi_endpoint_id does not exist.' + +By depending on both modules and using ``auto_install = True``, Odoo installs +this glue module only when both prerequisites are present, ensuring a safe +module loading order. diff --git a/edi_partner_endpoint_oca/__init__.py b/edi_partner_endpoint_oca/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/edi_partner_endpoint_oca/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/edi_partner_endpoint_oca/__manifest__.py b/edi_partner_endpoint_oca/__manifest__.py new file mode 100644 index 000000000..12bca04cc --- /dev/null +++ b/edi_partner_endpoint_oca/__manifest__.py @@ -0,0 +1,21 @@ +# Copyright 2026 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + "name": "EDI Partner Endpoint Glue", + "summary": """ + Glue module between edi_partner_oca and edi_endpoint_oca.""", + "version": "18.0.1.0.0", + "development_status": "Alpha", + "license": "AGPL-3", + "author": "Camptocamp,Odoo Community Association (OCA)", + "website": "https://github.com/OCA/edi-framework", + "depends": [ + "edi_partner_oca", + "edi_endpoint_oca", + ], + "data": [ + "views/partner_views.xml", + ], + "auto_install": True, +} diff --git a/edi_partner_endpoint_oca/models/__init__.py b/edi_partner_endpoint_oca/models/__init__.py new file mode 100644 index 000000000..91fed54d4 --- /dev/null +++ b/edi_partner_endpoint_oca/models/__init__.py @@ -0,0 +1 @@ +from . import res_partner diff --git a/edi_partner_endpoint_oca/models/res_partner.py b/edi_partner_endpoint_oca/models/res_partner.py new file mode 100644 index 000000000..7406f0df4 --- /dev/null +++ b/edi_partner_endpoint_oca/models/res_partner.py @@ -0,0 +1,16 @@ +# Copyright 2026 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class ResPartner(models.Model): + _inherit = "res.partner" + + origin_edi_endpoint_id = fields.Many2one( + string="EDI origin endpoint", + comodel_name="edi.endpoint", + ondelete="set null", + related="origin_exchange_record_id.edi_endpoint_id", + store=True, + ) diff --git a/edi_partner_endpoint_oca/pyproject.toml b/edi_partner_endpoint_oca/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/edi_partner_endpoint_oca/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/edi_partner_endpoint_oca/views/partner_views.xml b/edi_partner_endpoint_oca/views/partner_views.xml new file mode 100644 index 000000000..cf4c99315 --- /dev/null +++ b/edi_partner_endpoint_oca/views/partner_views.xml @@ -0,0 +1,26 @@ + + + + + res.partner.form - edi_partner_endpoint_oca + res.partner + + + + + + + + + + res.partner.tree - edi_partner_endpoint_oca + res.partner + + + + + + + + diff --git a/edi_partner_oca/README.rst b/edi_partner_oca/README.rst new file mode 100644 index 000000000..1c455805d --- /dev/null +++ b/edi_partner_oca/README.rst @@ -0,0 +1,83 @@ +============ +EDI Partners +============ + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:402c72cf354f15d32f132bb78b159c6e60cfdf31d7ff68bda16ee2435dca1d3e + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |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/18.0/edi_partner_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-18-0/edi-framework-18-0-edi_partner_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=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module intends to create a base to be extended by local edi rules +for partner. + +**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 +------------ + +- Jacques-Etienne Baudoux +- Duong (Tran Quoc) + +Other credits +------------- + +The creation of this module was financially supported by Camptocamp + +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-framework `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/edi_partner_oca/__init__.py b/edi_partner_oca/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/edi_partner_oca/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/edi_partner_oca/__manifest__.py b/edi_partner_oca/__manifest__.py new file mode 100644 index 000000000..0e74e7bbe --- /dev/null +++ b/edi_partner_oca/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright 2024 Jacques-Etienne Baudoux (BCIM) +# Copyright 2024 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + "name": "EDI Partners", + "summary": """ + EDI framework configuration and base logic for partners""", + "version": "18.0.1.0.1", + "license": "AGPL-3", + "author": "Camptocamp,Odoo Community Association (OCA)", + "website": "https://github.com/OCA/edi-framework", + "depends": [ + "contacts", + "edi_core_oca", + ], + "data": ["views/partner_views.xml"], +} diff --git a/edi_partner_oca/models/__init__.py b/edi_partner_oca/models/__init__.py new file mode 100644 index 000000000..91fed54d4 --- /dev/null +++ b/edi_partner_oca/models/__init__.py @@ -0,0 +1 @@ +from . import res_partner diff --git a/edi_partner_oca/models/res_partner.py b/edi_partner_oca/models/res_partner.py new file mode 100644 index 000000000..fb33b50d0 --- /dev/null +++ b/edi_partner_oca/models/res_partner.py @@ -0,0 +1,10 @@ +# Copyright 2024 Jacques-Etienne Baudoux (BCIM) +# Copyright 2024 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import models + + +class ResPartner(models.Model): + _name = "res.partner" + _inherit = ["res.partner", "edi.exchange.consumer.mixin"] diff --git a/edi_partner_oca/pyproject.toml b/edi_partner_oca/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/edi_partner_oca/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/edi_partner_oca/readme/CONTRIBUTORS.md b/edi_partner_oca/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..1a2eddb7a --- /dev/null +++ b/edi_partner_oca/readme/CONTRIBUTORS.md @@ -0,0 +1,2 @@ +- Jacques-Etienne Baudoux \ +- Duong (Tran Quoc) \ diff --git a/edi_partner_oca/readme/CREDITS.md b/edi_partner_oca/readme/CREDITS.md new file mode 100644 index 000000000..35e239a00 --- /dev/null +++ b/edi_partner_oca/readme/CREDITS.md @@ -0,0 +1 @@ +The creation of this module was financially supported by Camptocamp diff --git a/edi_partner_oca/readme/DESCRIPTION.md b/edi_partner_oca/readme/DESCRIPTION.md new file mode 100644 index 000000000..41eda9f6b --- /dev/null +++ b/edi_partner_oca/readme/DESCRIPTION.md @@ -0,0 +1,2 @@ +This module intends to create a base to be extended by local edi rules +for partner. diff --git a/edi_partner_oca/static/description/icon.png b/edi_partner_oca/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/edi_partner_oca/static/description/icon.png differ diff --git a/edi_partner_oca/static/description/index.html b/edi_partner_oca/static/description/index.html new file mode 100644 index 000000000..1c555d9a9 --- /dev/null +++ b/edi_partner_oca/static/description/index.html @@ -0,0 +1,430 @@ + + + + + +EDI Partners + + + +
+

EDI Partners

+ + +

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

+

This module intends to create a base to be extended by local edi rules +for partner.

+

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

+ +
+
+

Other credits

+

The creation of this module was financially supported by Camptocamp

+
+
+

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-framework project on GitHub.

+

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

+
+
+
+ + diff --git a/edi_partner_oca/views/partner_views.xml b/edi_partner_oca/views/partner_views.xml new file mode 100644 index 000000000..81deddedd --- /dev/null +++ b/edi_partner_oca/views/partner_views.xml @@ -0,0 +1,28 @@ + + + + res.partner.form - edi_partner_oca + res.partner + + + + + +
+ +
+
+
+
diff --git a/edi_sale_endpoint/__init__.py b/edi_sale_endpoint/__init__.py index e69de29bb..0650744f6 100644 --- a/edi_sale_endpoint/__init__.py +++ b/edi_sale_endpoint/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/edi_sale_endpoint/models/__init__.py b/edi_sale_endpoint/models/__init__.py new file mode 100644 index 000000000..6aacb7531 --- /dev/null +++ b/edi_sale_endpoint/models/__init__.py @@ -0,0 +1 @@ +from . import sale_order diff --git a/edi_endpoint_oca/models/edi_exchange_consumer_mixin.py b/edi_sale_endpoint/models/sale_order.py similarity index 54% rename from edi_endpoint_oca/models/edi_exchange_consumer_mixin.py rename to edi_sale_endpoint/models/sale_order.py index 248704fc9..3796dfd02 100644 --- a/edi_endpoint_oca/models/edi_exchange_consumer_mixin.py +++ b/edi_sale_endpoint/models/sale_order.py @@ -5,8 +5,8 @@ from odoo import fields, models -class EDIExchangeConsumerMixin(models.AbstractModel): - _inherit = "edi.exchange.consumer.mixin" +class SaleOrder(models.Model): + _inherit = "sale.order" origin_edi_endpoint_id = fields.Many2one( string="EDI origin endpoint", @@ -16,3 +16,15 @@ class EDIExchangeConsumerMixin(models.AbstractModel): # Store it to ease searching store=True, ) + + +class SaleOrderLine(models.Model): + _inherit = "sale.order.line" + + origin_edi_endpoint_id = fields.Many2one( + string="EDI origin endpoint", + comodel_name="edi.endpoint", + ondelete="set null", + related="origin_exchange_record_id.edi_endpoint_id", + store=True, + )