Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions edi_storage_oca/models/edi_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,27 +59,6 @@ class EDIBackend(models.Model):
"Output error directory", help="Path to folder for error operations"
)

def _get_component_usage_candidates(self, exchange_record, key):
candidates = super()._get_component_usage_candidates(exchange_record, key)
if not self.storage_id or key not in self._storage_actions:
return candidates
return [f"storage.{key}"] + candidates

def _component_match_attrs(self, exchange_record, key):
# Override to inject storage_type
res = super()._component_match_attrs(exchange_record, key)
if not self.storage_id or key not in self._storage_actions:
return res
res["storage_type"] = self.sudo().storage_id.protocol
return res

def _component_sort_key(self, component_class):
res = super()._component_sort_key(component_class)
# Override to give precedence by storage_type when needed.
if not self.storage_id:
return res
return (1 if getattr(component_class, "_storage_type", False) else 0,) + res

def _storage_cron_check_pending_input(self, **kw):
for backend in self:
backend._storage_check_pending_input(**kw)
Expand Down