From ee2cbc2f797c8831e4cba4abab5145616d3a1d96 Mon Sep 17 00:00:00 2001 From: Simone Orsi Date: Thu, 14 Nov 2024 14:11:48 +0100 Subject: [PATCH 1/7] edi_sale_oca: use specific demo data for tests --- edi_sale_oca/__manifest__.py | 4 +++ edi_sale_oca/demo/edi_backend.xml | 11 ++++++++ edi_sale_oca/demo/edi_exchange_type.xml | 37 +++++++++++++++++++++++++ edi_sale_oca/tests/test_order.py | 4 +++ edi_sale_oca/tests/test_process.py | 28 ++++--------------- 5 files changed, 62 insertions(+), 22 deletions(-) create mode 100644 edi_sale_oca/demo/edi_backend.xml create mode 100644 edi_sale_oca/demo/edi_exchange_type.xml diff --git a/edi_sale_oca/__manifest__.py b/edi_sale_oca/__manifest__.py index b469cdc1f8..a7abc17a0a 100644 --- a/edi_sale_oca/__manifest__.py +++ b/edi_sale_oca/__manifest__.py @@ -24,4 +24,8 @@ "views/edi_exchange_record.xml", "templates/exchange_chatter_msg.xml", ], + "demo": [ + "demo/edi_backend.xml", + "demo/edi_exchange_type.xml", + ], } diff --git a/edi_sale_oca/demo/edi_backend.xml b/edi_sale_oca/demo/edi_backend.xml new file mode 100644 index 0000000000..dde2c115e6 --- /dev/null +++ b/edi_sale_oca/demo/edi_backend.xml @@ -0,0 +1,11 @@ + + + + SALE DEMO + sale_demo + + + SALE DEMO + + + diff --git a/edi_sale_oca/demo/edi_exchange_type.xml b/edi_sale_oca/demo/edi_exchange_type.xml new file mode 100644 index 0000000000..8f144afa56 --- /dev/null +++ b/edi_sale_oca/demo/edi_exchange_type.xml @@ -0,0 +1,37 @@ + + + + + + Demo Sale Order Response + demo_SaleOrderResponse_out + output + {record_name}-{type.code}-{dt} + xml + +components: + generate: + usage: output.sale.generate.demo.OrderResponse + + + + + + + + Demo Sale Order + demo_SaleOrder_in + input + xml + +components: + process: + usage: input.process.sale.order + env_ctx: + default_price_source: 'pricelist' + default_import_type: 'xml' + random_key: custom + + + + diff --git a/edi_sale_oca/tests/test_order.py b/edi_sale_oca/tests/test_order.py index 3f231c3808..8a18238075 100644 --- a/edi_sale_oca/tests/test_order.py +++ b/edi_sale_oca/tests/test_order.py @@ -24,6 +24,10 @@ def setUpClass(cls): origin_exchange_record_id=cls.exc_record_in.id, ) + @classmethod + def _get_backend(cls): + return cls.env.ref("edi_sale_oca.demo_edi_backend") + def test_line_origin(self): order = self.sale self.assertEqual(order.origin_exchange_record_id, self.exc_record_in) diff --git a/edi_sale_oca/tests/test_process.py b/edi_sale_oca/tests/test_process.py index 20b80296bd..bba078a018 100644 --- a/edi_sale_oca/tests/test_process.py +++ b/edi_sale_oca/tests/test_process.py @@ -3,7 +3,6 @@ # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). import base64 -import textwrap from unittest import mock from odoo.addons.component.tests.common import SavepointComponentCase @@ -16,32 +15,17 @@ def setUpClass(cls): super().setUpClass() cls._setup_env() cls.backend = cls._get_backend() - cls.exc_type = cls._create_exchange_type( - name="Test SO import", - code="test_so_import", - direction="input", - exchange_file_ext="xml", - exchange_filename_pattern="{record.identifier}-{type.code}-{dt}", - backend_id=cls.backend.id, - # Bypass required fields with default_import_type = 'xml' in sale_order_import - advanced_settings_edit=textwrap.dedent( - """ - components: - process: - usage: input.process.sale.order - env_ctx: - default_price_source: 'pricelist' - default_import_type: 'xml' - random_key: custom - """ - ), - ) + cls.exc_type = cls.env.ref("edi_sale_oca.demo_edi_exc_type_order_in") cls.record = cls.backend.create_record( - "test_so_import", {"edi_exchange_state": "input_received"} + cls.exc_type.code, {"edi_exchange_state": "input_received"} ) cls.record._set_file_content(b"") cls.wiz_model = cls.env["sale.order.import"] + @classmethod + def _get_backend(cls): + return cls.env.ref("edi_sale_oca.demo_edi_backend") + def test_lookup(self): comp = self.backend._get_component(self.record, "process") self.assertEqual(comp._name, "edi.input.sale.order.process") From d7731b993303032073401821ec4d9af9984bf291 Mon Sep 17 00:00:00 2001 From: Simone Orsi Date: Mon, 18 Nov 2024 17:56:58 +0100 Subject: [PATCH 2/7] edi_sale_oca: improve test mixin --- edi_sale_oca/tests/common.py | 5 +++-- edi_sale_oca/tests/test_order.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/edi_sale_oca/tests/common.py b/edi_sale_oca/tests/common.py index 2fc1f15406..523642abb6 100644 --- a/edi_sale_oca/tests/common.py +++ b/edi_sale_oca/tests/common.py @@ -46,5 +46,6 @@ def _setup_order(cls, **kw): if line_defaults: for line in vals["order_line"]: line.update(line_defaults) - cls.sale = cls._create_sale_order(**vals) - cls.sale.action_confirm() + sale = cls._create_sale_order(**vals) + sale.action_confirm() + return sale diff --git a/edi_sale_oca/tests/test_order.py b/edi_sale_oca/tests/test_order.py index 8a18238075..da5591c512 100644 --- a/edi_sale_oca/tests/test_order.py +++ b/edi_sale_oca/tests/test_order.py @@ -20,7 +20,7 @@ def setUpClass(cls): cls.exc_record_in = cls.backend.create_record( cls.exchange_type_in.code, {"edi_exchange_state": "input_received"} ) - cls._setup_order( + cls.order = cls._setup_order( origin_exchange_record_id=cls.exc_record_in.id, ) @@ -29,7 +29,7 @@ def _get_backend(cls): return cls.env.ref("edi_sale_oca.demo_edi_backend") def test_line_origin(self): - order = self.sale + order = self.order self.assertEqual(order.origin_exchange_record_id, self.exc_record_in) lines = order.order_line self.env["sale.order.line"].create( From b0a5b0cfa3e0bac0a013618605a9e14221d92294 Mon Sep 17 00:00:00 2001 From: Simone Orsi Date: Fri, 15 Nov 2024 17:05:28 +0100 Subject: [PATCH 3/7] edi_sale_oca: handle existing order drop dead code This piece of code was never executed because it should have been done with a new cursor. Yet, there's no need to post a message on the order. Another point is: shall we simply avoid failing and return the msg to the job result? --- edi_sale_oca/__manifest__.py | 1 - edi_sale_oca/components/process.py | 18 +-------- .../templates/exchange_chatter_msg.xml | 37 ------------------- 3 files changed, 2 insertions(+), 54 deletions(-) delete mode 100644 edi_sale_oca/templates/exchange_chatter_msg.xml diff --git a/edi_sale_oca/__manifest__.py b/edi_sale_oca/__manifest__.py index a7abc17a0a..a632ac71fe 100644 --- a/edi_sale_oca/__manifest__.py +++ b/edi_sale_oca/__manifest__.py @@ -22,7 +22,6 @@ "views/res_partner.xml", "views/sale_order.xml", "views/edi_exchange_record.xml", - "templates/exchange_chatter_msg.xml", ], "demo": [ "demo/edi_backend.xml", diff --git a/edi_sale_oca/components/process.py b/edi_sale_oca/components/process.py index 456c0a3957..fdee534b79 100644 --- a/edi_sale_oca/components/process.py +++ b/edi_sale_oca/components/process.py @@ -61,19 +61,5 @@ def _handle_create_order(self, order_id): return order def _handle_existing_order(self, order, message): - prev_record = self._get_previous_record(order) - self.exchange_record.message_post_with_view( - "edi_sale_oca.message_already_imported", - values={ - "order": order, - "prev_record": prev_record, - "message": message, - "level": "info", - }, - subtype_id=self.env.ref("mail.mt_note").id, - ) - - def _get_previous_record(self, order): - return self.env["edi.exchange.record"].search( - [("model", "=", "sale.order"), ("res_id", "=", order.id)], limit=1 - ) + # Hook + pass diff --git a/edi_sale_oca/templates/exchange_chatter_msg.xml b/edi_sale_oca/templates/exchange_chatter_msg.xml deleted file mode 100644 index b57444cc5a..0000000000 --- a/edi_sale_oca/templates/exchange_chatter_msg.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - From 0c2c5507ff28ca74d70350ea1b5221adb98bd799 Mon Sep 17 00:00:00 2001 From: Simone Orsi Date: Thu, 28 Nov 2024 12:57:42 +0100 Subject: [PATCH 4/7] edi_sale_oca: drop dead job function Was used only when plugged w/ edi_exchange_type_auto in a prototype. --- edi_sale_oca/__manifest__.py | 1 - edi_sale_oca/data/job_function.xml | 7 ------- 2 files changed, 8 deletions(-) delete mode 100644 edi_sale_oca/data/job_function.xml diff --git a/edi_sale_oca/__manifest__.py b/edi_sale_oca/__manifest__.py index a632ac71fe..8a613d4fa2 100644 --- a/edi_sale_oca/__manifest__.py +++ b/edi_sale_oca/__manifest__.py @@ -18,7 +18,6 @@ "sale_order_import", ], "data": [ - "data/job_function.xml", "views/res_partner.xml", "views/sale_order.xml", "views/edi_exchange_record.xml", diff --git a/edi_sale_oca/data/job_function.xml b/edi_sale_oca/data/job_function.xml deleted file mode 100644 index 94d62e089a..0000000000 --- a/edi_sale_oca/data/job_function.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - _edi_auto_handle_generate - - - From 66cad70e80edc128f4107fd1f26f553a9486f426 Mon Sep 17 00:00:00 2001 From: Simone Orsi Date: Thu, 28 Nov 2024 13:04:22 +0100 Subject: [PATCH 5/7] edi_sale_oca: split input to edi_sale_input_oca --- edi_sale_input_oca/README.rst | 1 + edi_sale_input_oca/__init__.py | 2 + edi_sale_input_oca/__manifest__.py | 24 ++++ edi_sale_input_oca/components/__init__.py | 1 + .../components/process.py | 0 edi_sale_input_oca/demo/edi_exchange_type.xml | 22 ++++ edi_sale_input_oca/readme/CONTRIBUTORS.rst | 3 + edi_sale_input_oca/readme/CREDITS.rst | 1 + edi_sale_input_oca/readme/DESCRIPTION.rst | 27 ++++ edi_sale_input_oca/tests/__init__.py | 1 + edi_sale_input_oca/tests/common.py | 51 ++++++++ .../tests/test_process.py | 2 +- .../wizard/__init__.py | 0 .../wizard/sale_order_import.py | 0 edi_sale_oca/README.rst | 123 +----------------- edi_sale_oca/__init__.py | 1 - edi_sale_oca/__manifest__.py | 2 +- edi_sale_oca/components/__init__.py | 1 - edi_sale_oca/demo/edi_exchange_type.xml | 20 +-- edi_sale_oca/i18n/edi_sale_oca.pot | 12 -- edi_sale_oca/readme/DESCRIPTION.rst | 30 +---- edi_sale_oca/tests/__init__.py | 1 - .../odoo/addons/edi_sale_input_oca | 1 + setup/edi_sale_input_oca/setup.py | 6 + 24 files changed, 151 insertions(+), 181 deletions(-) create mode 100644 edi_sale_input_oca/README.rst create mode 100644 edi_sale_input_oca/__init__.py create mode 100644 edi_sale_input_oca/__manifest__.py create mode 100644 edi_sale_input_oca/components/__init__.py rename {edi_sale_oca => edi_sale_input_oca}/components/process.py (100%) create mode 100644 edi_sale_input_oca/demo/edi_exchange_type.xml create mode 100644 edi_sale_input_oca/readme/CONTRIBUTORS.rst create mode 100644 edi_sale_input_oca/readme/CREDITS.rst create mode 100644 edi_sale_input_oca/readme/DESCRIPTION.rst create mode 100644 edi_sale_input_oca/tests/__init__.py create mode 100644 edi_sale_input_oca/tests/common.py rename {edi_sale_oca => edi_sale_input_oca}/tests/test_process.py (98%) rename {edi_sale_oca => edi_sale_input_oca}/wizard/__init__.py (100%) rename {edi_sale_oca => edi_sale_input_oca}/wizard/sale_order_import.py (100%) create mode 120000 setup/edi_sale_input_oca/odoo/addons/edi_sale_input_oca create mode 100644 setup/edi_sale_input_oca/setup.py diff --git a/edi_sale_input_oca/README.rst b/edi_sale_input_oca/README.rst new file mode 100644 index 0000000000..aab07cbf95 --- /dev/null +++ b/edi_sale_input_oca/README.rst @@ -0,0 +1 @@ +bot please :) diff --git a/edi_sale_input_oca/__init__.py b/edi_sale_input_oca/__init__.py new file mode 100644 index 0000000000..041e7ec243 --- /dev/null +++ b/edi_sale_input_oca/__init__.py @@ -0,0 +1,2 @@ +from . import components +from . import wizard diff --git a/edi_sale_input_oca/__manifest__.py b/edi_sale_input_oca/__manifest__.py new file mode 100644 index 0000000000..2cc019ee9b --- /dev/null +++ b/edi_sale_input_oca/__manifest__.py @@ -0,0 +1,24 @@ +# Copyright 2022 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "EDI Sales input", + "summary": """ + Process incoming sale orders with the EDI framework. + """, + "version": "14.0.1.0.0", + "development_status": "Alpha", + "license": "AGPL-3", + "author": "Camptocamp,Odoo Community Association (OCA)", + "maintainers": ["simahawk"], + "website": "https://github.com/OCA/edi", + "depends": [ + "edi_sale_oca", + "edi_record_metadata_oca", + "sale_order_import", + ], + "data": [], + "demo": [ + "demo/edi_exchange_type.xml", + ], +} diff --git a/edi_sale_input_oca/components/__init__.py b/edi_sale_input_oca/components/__init__.py new file mode 100644 index 0000000000..bfb4ceb848 --- /dev/null +++ b/edi_sale_input_oca/components/__init__.py @@ -0,0 +1 @@ +from . import process diff --git a/edi_sale_oca/components/process.py b/edi_sale_input_oca/components/process.py similarity index 100% rename from edi_sale_oca/components/process.py rename to edi_sale_input_oca/components/process.py diff --git a/edi_sale_input_oca/demo/edi_exchange_type.xml b/edi_sale_input_oca/demo/edi_exchange_type.xml new file mode 100644 index 0000000000..bec19fddc4 --- /dev/null +++ b/edi_sale_input_oca/demo/edi_exchange_type.xml @@ -0,0 +1,22 @@ + + + + + + + Demo Sale Order + demo_SaleOrder_in + input + xml + +components: + process: + usage: input.process.sale.order + env_ctx: + default_price_source: 'pricelist' + default_import_type: 'xml' + random_key: custom + + + + diff --git a/edi_sale_input_oca/readme/CONTRIBUTORS.rst b/edi_sale_input_oca/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..ab783cd7d3 --- /dev/null +++ b/edi_sale_input_oca/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* Simone Orsi +* Duong (Tran Quoc) +* Thien (Vo Hong) diff --git a/edi_sale_input_oca/readme/CREDITS.rst b/edi_sale_input_oca/readme/CREDITS.rst new file mode 100644 index 0000000000..4c5b2fca2a --- /dev/null +++ b/edi_sale_input_oca/readme/CREDITS.rst @@ -0,0 +1 @@ +The migration of this module from 14.0 to 16.0 was financially supported by Camptocamp. diff --git a/edi_sale_input_oca/readme/DESCRIPTION.rst b/edi_sale_input_oca/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..55cdc88ede --- /dev/null +++ b/edi_sale_input_oca/readme/DESCRIPTION.rst @@ -0,0 +1,27 @@ +Inbound +~~~~~~~ +Receive sale orders from EDI channels. + +Control sale order confirmation +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can decide if the order should be confirmed by exchange type. + +On your exchange type, go to advanced settings and add the following:: + + [...] + components: + process: + usage: input.process.sale.order + env_ctx: + # Values for the wizard + default_confirm_order: true + default_price_source: order + # Custom keys, whatever you need + random_one: true + +Note that `env_ctx` will propagate all keys to the whole env so you can use it +for any kind of context related configuration. In the case of the sale order import wizard +here we are just passing defaults as we could do in odoo standard. + +TODO: shall we add an exchange type example as demo? diff --git a/edi_sale_input_oca/tests/__init__.py b/edi_sale_input_oca/tests/__init__.py new file mode 100644 index 0000000000..c2bb451dd1 --- /dev/null +++ b/edi_sale_input_oca/tests/__init__.py @@ -0,0 +1 @@ +from . import test_process diff --git a/edi_sale_input_oca/tests/common.py b/edi_sale_input_oca/tests/common.py new file mode 100644 index 0000000000..523642abb6 --- /dev/null +++ b/edi_sale_input_oca/tests/common.py @@ -0,0 +1,51 @@ +# Copyright 2022 Camptocamp SA +# @author: Simone Orsi +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields + + +class OrderMixin(object): + @classmethod + def _create_sale_order(cls, **kw): + """Create a sale order + + :return: sale order + """ + model = cls.env["sale.order"] + vals = dict(commitment_date=fields.Date.today()) + vals.update(kw) + so_vals = model.play_onchanges(vals, []) + if "order_line" in so_vals: + so_vals["order_line"] = [(0, 0, x) for x in vals["order_line"]] + return model.create(so_vals) + + @classmethod + def _setup_order(cls, **kw): + cls.product_a = cls.env.ref("product.product_product_4") + cls.product_a.barcode = "1" * 14 + cls.product_b = cls.env.ref("product.product_product_4b") + cls.product_b.barcode = "2" * 14 + cls.product_c = cls.env.ref("product.product_product_4c") + cls.product_c.barcode = "3" * 14 + cls.product_d = cls.env.ref("product.product_product_5") + cls.product_d.barcode = "4" * 14 + line_defaults = kw.pop("line_defaults", {}) + vals = { + "partner_id": cls.env.ref("base.res_partner_10").id, + "commitment_date": "2022-07-29", + } + vals.update(kw) + if "client_order_ref" not in vals: + vals["client_order_ref"] = "ABC123" + vals["order_line"] = [ + {"product_id": cls.product_a.id, "product_uom_qty": 300, "edi_id": 1000}, + {"product_id": cls.product_b.id, "product_uom_qty": 200, "edi_id": 2000}, + {"product_id": cls.product_c.id, "product_uom_qty": 100, "edi_id": 3000}, + ] + if line_defaults: + for line in vals["order_line"]: + line.update(line_defaults) + sale = cls._create_sale_order(**vals) + sale.action_confirm() + return sale diff --git a/edi_sale_oca/tests/test_process.py b/edi_sale_input_oca/tests/test_process.py similarity index 98% rename from edi_sale_oca/tests/test_process.py rename to edi_sale_input_oca/tests/test_process.py index bba078a018..9792425989 100644 --- a/edi_sale_oca/tests/test_process.py +++ b/edi_sale_input_oca/tests/test_process.py @@ -15,7 +15,7 @@ def setUpClass(cls): super().setUpClass() cls._setup_env() cls.backend = cls._get_backend() - cls.exc_type = cls.env.ref("edi_sale_oca.demo_edi_exc_type_order_in") + cls.exc_type = cls.env.ref("edi_sale_input_oca.demo_edi_exc_type_order_in") cls.record = cls.backend.create_record( cls.exc_type.code, {"edi_exchange_state": "input_received"} ) diff --git a/edi_sale_oca/wizard/__init__.py b/edi_sale_input_oca/wizard/__init__.py similarity index 100% rename from edi_sale_oca/wizard/__init__.py rename to edi_sale_input_oca/wizard/__init__.py diff --git a/edi_sale_oca/wizard/sale_order_import.py b/edi_sale_input_oca/wizard/sale_order_import.py similarity index 100% rename from edi_sale_oca/wizard/sale_order_import.py rename to edi_sale_input_oca/wizard/sale_order_import.py diff --git a/edi_sale_oca/README.rst b/edi_sale_oca/README.rst index 136802b120..aab07cbf95 100644 --- a/edi_sale_oca/README.rst +++ b/edi_sale_oca/README.rst @@ -1,122 +1 @@ -========= -EDI Sales -========= - -.. - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! This file is generated by oca-gen-addon-readme !! - !! changes will be overwritten. !! - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:8cc00af990de28ee9679466fc10bfcfe395035c200137f800be3a5fbf69b987e - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -.. |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_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_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| - -Inbound -~~~~~~~ -Receive sale orders from EDI channels. - -Control sale order confirmation -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can decide if the order should be confirmed by exchange type. - -On your exchange type, go to advanced settings and add the following:: - - [...] - components: - process: - usage: input.process.sale.order - env_ctx: - # Values for the wizard - default_confirm_order: true - default_price_source: order - # Custom keys, whatever you need - random_one: true - -Note that `env_ctx` will propagate all keys to the whole env so you can use it -for any kind of context related configuration. In the case of the sale order import wizard -here we are just passing defaults as we could do in odoo standard. - -TODO: shall we add an exchange type example as demo? - -.. 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 -~~~~~~~~~~~~ - -* Simone Orsi -* Duong (Tran Quoc) -* Thien (Vo Hong) - -Other credits -~~~~~~~~~~~~~ - -The migration of this module from 14.0 to 16.0 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. - -.. |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 `_ project on GitHub. - -You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. +bot please :) diff --git a/edi_sale_oca/__init__.py b/edi_sale_oca/__init__.py index d2243add24..f24d3e2426 100644 --- a/edi_sale_oca/__init__.py +++ b/edi_sale_oca/__init__.py @@ -1,3 +1,2 @@ from . import components from . import models -from . import wizard diff --git a/edi_sale_oca/__manifest__.py b/edi_sale_oca/__manifest__.py index 8a613d4fa2..ff39e60058 100644 --- a/edi_sale_oca/__manifest__.py +++ b/edi_sale_oca/__manifest__.py @@ -15,7 +15,7 @@ "depends": [ "edi_oca", "edi_record_metadata_oca", - "sale_order_import", + "sale", ], "data": [ "views/res_partner.xml", diff --git a/edi_sale_oca/components/__init__.py b/edi_sale_oca/components/__init__.py index bfb4ceb848..e69de29bb2 100644 --- a/edi_sale_oca/components/__init__.py +++ b/edi_sale_oca/components/__init__.py @@ -1 +0,0 @@ -from . import process diff --git a/edi_sale_oca/demo/edi_exchange_type.xml b/edi_sale_oca/demo/edi_exchange_type.xml index 8f144afa56..49d9d08083 100644 --- a/edi_sale_oca/demo/edi_exchange_type.xml +++ b/edi_sale_oca/demo/edi_exchange_type.xml @@ -1,21 +1,7 @@ - - - - Demo Sale Order Response - demo_SaleOrderResponse_out - output - {record_name}-{type.code}-{dt} - xml - -components: - generate: - usage: output.sale.generate.demo.OrderResponse - - - - + + diff --git a/edi_sale_oca/i18n/edi_sale_oca.pot b/edi_sale_oca/i18n/edi_sale_oca.pot index 97be8f7366..d089769fe7 100644 --- a/edi_sale_oca/i18n/edi_sale_oca.pot +++ b/edi_sale_oca/i18n/edi_sale_oca.pot @@ -176,18 +176,6 @@ msgstr "" msgid "Sales Order Line" msgstr "" -#. module: edi_sale_oca -#: code:addons/edi_sale_oca/components/process.py:0 -#, python-format -msgid "Sales order %s created" -msgstr "" - -#. module: edi_sale_oca -#: code:addons/edi_sale_oca/components/process.py:0 -#, python-format -msgid "Sales order has already been imported before" -msgstr "" - #. module: edi_sale_oca #: model_terms:ir.ui.view,arch_db:edi_sale_oca.view_sales_order_filter msgid "Source: EDI" diff --git a/edi_sale_oca/readme/DESCRIPTION.rst b/edi_sale_oca/readme/DESCRIPTION.rst index 55cdc88ede..aa61922800 100644 --- a/edi_sale_oca/readme/DESCRIPTION.rst +++ b/edi_sale_oca/readme/DESCRIPTION.rst @@ -1,27 +1,7 @@ -Inbound -~~~~~~~ -Receive sale orders from EDI channels. +Handle sale orders via EDI. -Control sale order confirmation -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +This is a base module to plug sales processes with the EDI framework. -You can decide if the order should be confirmed by exchange type. - -On your exchange type, go to advanced settings and add the following:: - - [...] - components: - process: - usage: input.process.sale.order - env_ctx: - # Values for the wizard - default_confirm_order: true - default_price_source: order - # Custom keys, whatever you need - random_one: true - -Note that `env_ctx` will propagate all keys to the whole env so you can use it -for any kind of context related configuration. In the case of the sale order import wizard -here we are just passing defaults as we could do in odoo standard. - -TODO: shall we add an exchange type example as demo? +To handle inbound/outbound sale orders, +you need to use `edi_sale_input_oca` or `edi_sale_output_oca` modules, +or create your own modules. diff --git a/edi_sale_oca/tests/__init__.py b/edi_sale_oca/tests/__init__.py index 80e5225788..e6fb64b6b6 100644 --- a/edi_sale_oca/tests/__init__.py +++ b/edi_sale_oca/tests/__init__.py @@ -1,2 +1 @@ from . import test_order -from . import test_process diff --git a/setup/edi_sale_input_oca/odoo/addons/edi_sale_input_oca b/setup/edi_sale_input_oca/odoo/addons/edi_sale_input_oca new file mode 120000 index 0000000000..3cdc497054 --- /dev/null +++ b/setup/edi_sale_input_oca/odoo/addons/edi_sale_input_oca @@ -0,0 +1 @@ +../../../../edi_sale_input_oca \ No newline at end of file diff --git a/setup/edi_sale_input_oca/setup.py b/setup/edi_sale_input_oca/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/edi_sale_input_oca/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) From b62784190558100fde28c7f478cf41b7bd3b2db2 Mon Sep 17 00:00:00 2001 From: Simone Orsi Date: Fri, 29 Nov 2024 11:22:45 +0100 Subject: [PATCH 6/7] edi_sale_order_import: update deprecate msg --- edi_sale_order_import/hooks.py | 2 +- edi_sale_order_import/readme/DESCRIPTION.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/edi_sale_order_import/hooks.py b/edi_sale_order_import/hooks.py index 437ff54859..8051d2a6f3 100644 --- a/edi_sale_order_import/hooks.py +++ b/edi_sale_order_import/hooks.py @@ -7,7 +7,7 @@ def deprecate(): - _logger.warning("`edi_sale_order_import` is deprecated. Use `edi_sale_oca`") + _logger.warning("`edi_sale_order_import` is deprecated. Use `edi_sale_input_oca`") def post_load_hook(): diff --git a/edi_sale_order_import/readme/DESCRIPTION.rst b/edi_sale_order_import/readme/DESCRIPTION.rst index 5ab8b438b7..83d39dd4e4 100644 --- a/edi_sale_order_import/readme/DESCRIPTION.rst +++ b/edi_sale_order_import/readme/DESCRIPTION.rst @@ -1,4 +1,4 @@ -DEPRECATED: use `edi_sale_oca`. +DEPRECATED: use `edi_sale_input_oca`. Plug sale_order_import into EDI machinery. From f5c9ee134d02370bc72c3b16bde28686bbb9ef49 Mon Sep 17 00:00:00 2001 From: Simone Orsi Date: Fri, 29 Nov 2024 11:24:29 +0100 Subject: [PATCH 7/7] edi_sale_oca: 14.0.2.0.0 --- edi_sale_oca/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/edi_sale_oca/__manifest__.py b/edi_sale_oca/__manifest__.py index ff39e60058..1a5c93ac3a 100644 --- a/edi_sale_oca/__manifest__.py +++ b/edi_sale_oca/__manifest__.py @@ -6,7 +6,7 @@ "summary": """ Configuration and special behaviors for EDI on sales. """, - "version": "14.0.1.0.0", + "version": "14.0.2.0.0", "development_status": "Alpha", "license": "AGPL-3", "author": "Camptocamp,Odoo Community Association (OCA)",