From 3248cb7142fe8dc18766254f7fec5105e7a2292c Mon Sep 17 00:00:00 2001 From: Mathieu Date: Wed, 14 May 2025 10:24:41 +0200 Subject: [PATCH] wms_connector: add get_mappings function in attachment_queue to be able to add new values by inherit --- wms_connector/models/attachment_queue.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wms_connector/models/attachment_queue.py b/wms_connector/models/attachment_queue.py index 56381fac80e..835eb33d17b 100644 --- a/wms_connector/models/attachment_queue.py +++ b/wms_connector/models/attachment_queue.py @@ -46,8 +46,12 @@ def _compute_warehouse(self): else: rec.warehouse_id = None + @api.model + def _get_mappings(self): + return WMS_IMPORT_FILETYPES + def _run(self): - for filetype in [el[0] for el in WMS_IMPORT_FILETYPES]: + for filetype in [el[0] for el in self._get_mappings()]: if self.file_type == filetype: return getattr(self.with_company(self.company_id), "_run_" + filetype)() return super()._run()