From d023bb5918bbd38eade1f167ac2e40e89e4004b9 Mon Sep 17 00:00:00 2001 From: Simone Orsi Date: Fri, 15 Nov 2024 17:05:28 +0100 Subject: [PATCH] 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 653847e57e4..0c44666c37f 100644 --- a/edi_sale_oca/__manifest__.py +++ b/edi_sale_oca/__manifest__.py @@ -23,7 +23,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 456c0a3957d..fdee534b79b 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 b57444cc5a6..00000000000 --- a/edi_sale_oca/templates/exchange_chatter_msg.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - -