From 270a5e50c2fa12b37a8df59376ff10f6cd2cc9bc Mon Sep 17 00:00:00 2001 From: Francois Poizat Date: Mon, 20 Nov 2023 17:03:25 +0100 Subject: [PATCH] wms_connector: ADD adds method_type and filepath to task mappings for default task creation --- wms_connector/models/stock_warehouse.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/wms_connector/models/stock_warehouse.py b/wms_connector/models/stock_warehouse.py index fbe9ec2cc2..7ee9cbf015 100644 --- a/wms_connector/models/stock_warehouse.py +++ b/wms_connector/models/stock_warehouse.py @@ -60,6 +60,8 @@ "fieldname_task": "wms_import_confirm_reception_task_id", "fieldname_cron": "wms_import_confirm_reception_cron_id", "filetype": "wms_reception_confirmed", + "method_type": "import", + "filepath": "OUT/", "name_fragment": "reception confirmation", "code": "env['stock.warehouse'].browse({}).{}.run_import()", }, @@ -67,6 +69,8 @@ "fieldname_task": "wms_import_confirm_delivery_task_id", "fieldname_cron": "wms_import_confirm_delivery_cron_id", "filetype": "wms_delivery_confirmed", + "method_type": "import", + "filepath": "OUT/", "name_fragment": "delivery confirmation", "code": "env['stock.warehouse'].browse({}).{}.run_import()", }, @@ -136,7 +140,7 @@ def _activate_tasks(self): else: self[task_field_name] = self.env["attachment.synchronize.task"].create( self._prepare_wms_task_vals( - mappings["filetype"], mappings["name_fragment"] + mappings["filetype"], mappings["name_fragment"], mappings["method_type"], mappings["filepath"] ) ) @@ -171,11 +175,11 @@ def _activate_filters(self): "wms_export_picking_out_filter_id" ].format(self.out_type_id.id) - def _prepare_wms_task_vals(self, filetype, name_fragment=""): + def _prepare_wms_task_vals(self, filetype, name_fragment="", method_type="export", filepath="IN/"): return { "name": "WMS task for {} {}".format(self.name, name_fragment), - "method_type": "export", - "filepath": "IN/", + "method_type": method_type, + "filepath": filepath, "backend_id": self.env.ref("storage_backend.default_storage_backend").id, "file_type": filetype, }