From a2e012fe23e2628ff5633a0978cf2b56982be57a Mon Sep 17 00:00:00 2001 From: Arnau Date: Tue, 13 Jan 2026 15:37:24 +0100 Subject: [PATCH 1/6] [FIX] edi_storage_oca: ls whitespace filename with ftp protocol --- edi_storage_oca/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/edi_storage_oca/utils.py b/edi_storage_oca/utils.py index 0b93e5da0..0b791c09b 100644 --- a/edi_storage_oca/utils.py +++ b/edi_storage_oca/utils.py @@ -48,6 +48,8 @@ def list_files(storage, relative_path="", pattern=False): if pattern: relative_path = fs.sep.join([relative_path, pattern]) return fs.glob(relative_path) + if fs.protocol == "ftp" and fs.ftp: + return fs.ftp.nlst(relative_path) return fs.ls(relative_path, detail=False) From 2ef4db3e04925b40251c3aa4265b1b68117d8056 Mon Sep 17 00:00:00 2001 From: Arnau Date: Tue, 12 May 2026 14:19:38 +0200 Subject: [PATCH 2/6] [FIX] edi_storage_oca: raise error if file is missing when performing receive --- .../models/edi_oca_storage_handler.py | 34 ++++++++++++++++--- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/edi_storage_oca/models/edi_oca_storage_handler.py b/edi_storage_oca/models/edi_oca_storage_handler.py index ce0f7682f..3e2a3d938 100644 --- a/edi_storage_oca/models/edi_oca_storage_handler.py +++ b/edi_storage_oca/models/edi_oca_storage_handler.py @@ -9,6 +9,7 @@ from pathlib import PurePath from odoo import models +from odoo.exceptions import UserError from .. import utils @@ -34,7 +35,9 @@ def send(self, exchange_record): utils.add_file(exchange_record.backend_id.storage_id, path.as_posix(), filedata) def receive(self, exchange_record): - return self._get_remote_file(exchange_record, "pending", binary=True) + return self._get_remote_file( + exchange_record, "pending", binary=True, raise_if_missing=True + ) def _dir_by_state(self, backend, direction, state): """Return remote directory path by direction and state. @@ -61,11 +64,21 @@ def _get_remote_file_path(self, exchange_record, state, filename=None): ) return path - def _get_remote_file(self, exchange_record, state, filename=None, binary=False): + def _get_remote_file( + self, + exchange_record, + state, + filename=None, + binary=False, + raise_if_missing=False, + ): """Get file for current exchange_record in the given destination state. :param state: string ("pending", "done", "error") :param filename: custom file name, exchange_record filename used by default + :param raise_if_missing: when True, storage errors are re-raised as + swallable exceptions so the caller transitions the record to an + error state instead of treating "no content" as a successful read. :return: remote file content as string """ path = self._get_remote_file_path(exchange_record, state, filename=filename) @@ -84,14 +97,25 @@ def _get_remote_file(self, exchange_record, state, filename=None, binary=False): path, state, ) + if raise_if_missing: + raise return None - except OSError: - _logger.info( - "Ignored OSError when trying to get file %s into path %s for state %s", + except OSError as err: + _logger.warning( + "OSError when trying to get file %s into path %s for state %s: %s", filename, path, state, + err, ) + if raise_if_missing: + raise UserError( + self.env._( + "Storage error while reading %(path)s: %(error)s", + path=path.as_posix(), + error=str(err), + ) + ) from err return None def check(self, exchange_record): From 047a3deba3a58224ea92e4ddf269042fb844a95d Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Wed, 27 May 2026 06:41:14 +0000 Subject: [PATCH 3/6] [BOT] post-merge updates --- README.md | 2 +- edi_storage_oca/README.rst | 2 +- edi_storage_oca/__manifest__.py | 2 +- edi_storage_oca/static/description/index.html | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5406a0b2f..663a553fd 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ addon | version | maintainers | summary [edi_sale_ubl_output_oca](edi_sale_ubl_output_oca/) | 18.0.1.0.1 | | Configuration and special behaviors for EDI on sales. [edi_state_oca](edi_state_oca/) | 18.0.1.0.3 | simahawk | Allow to assign specific EDI states to related records. [edi_stock_oca](edi_stock_oca/) | 18.0.1.0.1 | | Define EDI Configuration for Stock -[edi_storage_oca](edi_storage_oca/) | 18.0.1.0.2 | | Base module to allow exchanging files via storage backend (eg: SFTP). +[edi_storage_oca](edi_storage_oca/) | 18.0.1.0.3 | | Base module to allow exchanging files via storage backend (eg: SFTP). [edi_storage_queue_oca](edi_storage_queue_oca/) | 18.0.1.0.0 | | Integrates EDI Storage with Queue [edi_ubl_oca](edi_ubl_oca/) | 18.0.1.0.1 | simahawk | Define EDI backend type for UBL. [edi_webservice_oca](edi_webservice_oca/) | 18.0.1.0.2 | etobella simahawk | Defines webservice integration from EDI Exchange records diff --git a/edi_storage_oca/README.rst b/edi_storage_oca/README.rst index 52b9f7ece..ff34c4027 100644 --- a/edi_storage_oca/README.rst +++ b/edi_storage_oca/README.rst @@ -11,7 +11,7 @@ EDI Storage backend support !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:ae52c0238c8bab278e4e2d6a48d86d4222672b893df1f171be046f3b7a3c58ae + !! source digest: sha256:2511ea918ba213d754909a73c92b80e89a7ab320816acd446f9e2dcf26c538d0 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/edi_storage_oca/__manifest__.py b/edi_storage_oca/__manifest__.py index 39f47e247..1f7b1d333 100644 --- a/edi_storage_oca/__manifest__.py +++ b/edi_storage_oca/__manifest__.py @@ -7,7 +7,7 @@ "summary": """ Base module to allow exchanging files via storage backend (eg: SFTP). """, - "version": "18.0.1.0.2", + "version": "18.0.1.0.3", "development_status": "Beta", "license": "LGPL-3", "website": "https://github.com/OCA/edi-framework", diff --git a/edi_storage_oca/static/description/index.html b/edi_storage_oca/static/description/index.html index 87b66f49d..9d7a9d130 100644 --- a/edi_storage_oca/static/description/index.html +++ b/edi_storage_oca/static/description/index.html @@ -372,7 +372,7 @@

EDI Storage backend support

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:ae52c0238c8bab278e4e2d6a48d86d4222672b893df1f171be046f3b7a3c58ae +!! source digest: sha256:2511ea918ba213d754909a73c92b80e89a7ab320816acd446f9e2dcf26c538d0 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

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

Allow exchange files using storage backends from OCA/storage.

From 872c28c15f7d93618e8f36e4b74bdf52e431f050 Mon Sep 17 00:00:00 2001 From: oca-ci Date: Wed, 27 May 2026 06:49:48 +0000 Subject: [PATCH 4/6] [UPD] Update edi_storage_oca.pot --- edi_storage_oca/i18n/edi_storage_oca.pot | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/edi_storage_oca/i18n/edi_storage_oca.pot b/edi_storage_oca/i18n/edi_storage_oca.pot index cba90f769..7b3703040 100644 --- a/edi_storage_oca/i18n/edi_storage_oca.pot +++ b/edi_storage_oca/i18n/edi_storage_oca.pot @@ -114,6 +114,12 @@ msgstr "" msgid "Storage Handler for EDI" msgstr "" +#. module: edi_storage_oca +#. odoo-python +#: code:addons/edi_storage_oca/models/edi_oca_storage_handler.py:0 +msgid "Storage error while reading %(path)s: %(error)s" +msgstr "" + #. module: edi_storage_oca #: model:ir.model.fields,help:edi_storage_oca.field_edi_backend__storage_id msgid "Storage for in-out files" From 6b602a1d0fde6afdfea00066bac0370bc29c39f1 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Wed, 27 May 2026 06:56:45 +0000 Subject: [PATCH 5/6] [BOT] post-merge updates --- README.md | 2 +- edi_storage_oca/README.rst | 2 +- edi_storage_oca/__manifest__.py | 2 +- edi_storage_oca/static/description/index.html | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 663a553fd..8cb915bcf 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ addon | version | maintainers | summary [edi_sale_ubl_output_oca](edi_sale_ubl_output_oca/) | 18.0.1.0.1 | | Configuration and special behaviors for EDI on sales. [edi_state_oca](edi_state_oca/) | 18.0.1.0.3 | simahawk | Allow to assign specific EDI states to related records. [edi_stock_oca](edi_stock_oca/) | 18.0.1.0.1 | | Define EDI Configuration for Stock -[edi_storage_oca](edi_storage_oca/) | 18.0.1.0.3 | | Base module to allow exchanging files via storage backend (eg: SFTP). +[edi_storage_oca](edi_storage_oca/) | 18.0.1.0.4 | | Base module to allow exchanging files via storage backend (eg: SFTP). [edi_storage_queue_oca](edi_storage_queue_oca/) | 18.0.1.0.0 | | Integrates EDI Storage with Queue [edi_ubl_oca](edi_ubl_oca/) | 18.0.1.0.1 | simahawk | Define EDI backend type for UBL. [edi_webservice_oca](edi_webservice_oca/) | 18.0.1.0.2 | etobella simahawk | Defines webservice integration from EDI Exchange records diff --git a/edi_storage_oca/README.rst b/edi_storage_oca/README.rst index ff34c4027..f880503b3 100644 --- a/edi_storage_oca/README.rst +++ b/edi_storage_oca/README.rst @@ -11,7 +11,7 @@ EDI Storage backend support !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:2511ea918ba213d754909a73c92b80e89a7ab320816acd446f9e2dcf26c538d0 + !! source digest: sha256:ca9c4e0d1ecd9744b5cfa517900a5dace2a206007360ce2c1299dc1da5910bfa !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/edi_storage_oca/__manifest__.py b/edi_storage_oca/__manifest__.py index 1f7b1d333..87b4c5f92 100644 --- a/edi_storage_oca/__manifest__.py +++ b/edi_storage_oca/__manifest__.py @@ -7,7 +7,7 @@ "summary": """ Base module to allow exchanging files via storage backend (eg: SFTP). """, - "version": "18.0.1.0.3", + "version": "18.0.1.0.4", "development_status": "Beta", "license": "LGPL-3", "website": "https://github.com/OCA/edi-framework", diff --git a/edi_storage_oca/static/description/index.html b/edi_storage_oca/static/description/index.html index 9d7a9d130..fe56fe211 100644 --- a/edi_storage_oca/static/description/index.html +++ b/edi_storage_oca/static/description/index.html @@ -372,7 +372,7 @@

EDI Storage backend support

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:2511ea918ba213d754909a73c92b80e89a7ab320816acd446f9e2dcf26c538d0 +!! source digest: sha256:ca9c4e0d1ecd9744b5cfa517900a5dace2a206007360ce2c1299dc1da5910bfa !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

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

Allow exchange files using storage backends from OCA/storage.

From 27ffba4ddd7ea98e590226477d5bd47f66b770cd Mon Sep 17 00:00:00 2001 From: Weblate Date: Wed, 27 May 2026 06:56:55 +0000 Subject: [PATCH 6/6] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: edi-framework-18.0/edi-framework-18.0-edi_storage_oca Translate-URL: https://translation.odoo-community.org/projects/edi-framework-18-0/edi-framework-18-0-edi_storage_oca/ --- edi_storage_oca/i18n/it.po | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/edi_storage_oca/i18n/it.po b/edi_storage_oca/i18n/it.po index e35011ab4..ce7ead09f 100644 --- a/edi_storage_oca/i18n/it.po +++ b/edi_storage_oca/i18n/it.po @@ -28,7 +28,6 @@ msgstr "Tipo scambio EDI" #. module: edi_storage_oca #: model:ir.actions.server,name:edi_storage_oca.cron_check_storage_pending_input_ir_actions_server -#: model:ir.cron,cron_name:edi_storage_oca.cron_check_storage_pending_input msgid "EDI backend storage check pending input" msgstr "Controllo ingressi in attesa deposito backend EDI" @@ -51,8 +50,13 @@ msgstr "Deposito FS" #. module: edi_storage_oca #: model:ir.model.fields,help:edi_storage_oca.field_edi_exchange_type__exchange_filename_pattern msgid "" -"For output exchange types this should be a formatting string with the following variables available (to be used between brackets, `{}`): `exchange_record`, `record_name`, `type` and `dt`. For instance, a valid string would be {record_name}-{type.code}-{dt}\n" -"For input exchange types related to storage backends it should be a regex expression to filter the files to be fetched from the pending directory in the related storage. E.g: `.*my-type-[0-9]*.\\.csv`" +"For output exchange types this should be a formatting string with the " +"following variables available (to be used between brackets, `{}`): " +"`exchange_record`, `record_name`, `type` and `dt`. For instance, a valid " +"string would be {record_name}-{type.code}-{dt}\n" +"For input exchange types related to storage backends it should be a regex " +"expression to filter the files to be fetched from the pending directory in " +"the related storage. E.g: `.*my-type-[0-9]*.\\.csv`" msgstr "" "Per i tipi di scambio in uscita questo dovrebbe essere una stringa di " "formattazione con le seguenti variabili disponibili (da utilizzare tra " @@ -120,6 +124,17 @@ msgstr "Record creato da un file trovato nel deposito FS" msgid "Storage" msgstr "Deposito" +#. module: edi_storage_oca +#: model:ir.model,name:edi_storage_oca.model_edi_oca_storage_handler +msgid "Storage Handler for EDI" +msgstr "" + +#. module: edi_storage_oca +#. odoo-python +#: code:addons/edi_storage_oca/models/edi_oca_storage_handler.py:0 +msgid "Storage error while reading %(path)s: %(error)s" +msgstr "" + #. module: edi_storage_oca #: model:ir.model.fields,help:edi_storage_oca.field_edi_backend__storage_id msgid "Storage for in-out files"