diff --git a/edi_storage_oca/components/base.py b/edi_storage_oca/components/base.py index f03cc016b7..ba7a2202ee 100644 --- a/edi_storage_oca/components/base.py +++ b/edi_storage_oca/components/base.py @@ -79,7 +79,7 @@ def _get_remote_file(self, state, filename=None, binary=False): # TODO: support match via pattern (eg: filename-prefix-*) # otherwise is impossible to retrieve input files and acks # (the date will never match) - return self.storage._get_b64_data(path.as_posix(), binary=binary) + return self.storage.sudo()._get_b64_data(path.as_posix(), binary=binary) except FileNotFoundError: _logger.info( "Ignored FileNotFoundError when trying " diff --git a/edi_storage_oca/components/send.py b/edi_storage_oca/components/send.py index 9267f6847d..d26e5e07a4 100644 --- a/edi_storage_oca/components/send.py +++ b/edi_storage_oca/components/send.py @@ -25,7 +25,7 @@ def send(self): return True filedata = self.exchange_record.exchange_file path = self._get_remote_file_path("pending") - self.storage._add_b64_data(path.as_posix(), filedata, binary=False) + self.storage.sudo()._add_b64_data(path.as_posix(), filedata, binary=False) # TODO: delegate this to generic storage backend # except paramiko.ssh_exception.AuthenticationException: # # TODO this exc handling should be moved to sftp backend IMO diff --git a/edi_storage_oca/models/edi_backend.py b/edi_storage_oca/models/edi_backend.py index d9ff6c4552..5ccfbfadd0 100644 --- a/edi_storage_oca/models/edi_backend.py +++ b/edi_storage_oca/models/edi_backend.py @@ -72,7 +72,7 @@ def _component_match_attrs(self, exchange_record, key): res = super()._component_match_attrs(exchange_record, key) if not self.storage_id or key not in self._storage_actions: return res - res["storage_backend_type"] = self.storage_id.backend_type + res["storage_backend_type"] = self.sudo().storage_id.backend_type return res def _component_sort_key(self, component_class):