Skip to content

Commit

Permalink
[IMP] edi_oca: Add hook on new output exchange record search
Browse files Browse the repository at this point in the history
  • Loading branch information
HviorForgeFlow authored and MiquelRForgeFlow committed Oct 9, 2024
1 parent 059f27b commit b6471a3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions edi_oca/models/edi_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,7 @@ def _check_output_exchange_sync(
:param skip_sent: ignore records that were already sent.
"""
# Generate output files
new_records = self.exchange_record_model.search(
self._output_new_records_domain(record_ids=record_ids)
)
new_records = self._get_new_output_exchange_records(record_ids=record_ids)
_logger.info(
"EDI Exchange output sync: found %d new records to process.",
len(new_records),
Expand Down Expand Up @@ -440,6 +438,11 @@ def _check_output_exchange_sync(
# TODO: run in job as well?
self._exchange_output_check_state(rec)

def _get_new_output_exchange_records(self, record_ids=None):
return self.exchange_record_model.search(
self._output_new_records_domain(record_ids=record_ids)
)

def _output_new_records_domain(self, record_ids=None):
"""Domain for output records needing output content generation."""
domain = [
Expand Down

0 comments on commit b6471a3

Please sign in to comment.