Skip to content

[19.0][IMP] edi_core_oca: skip exchange types w/o handler in cron domains#273

Open
HviorForgeFlow wants to merge 2 commits into
OCA:19.0from
ForgeFlow:19.0-imp-edi_core_oca-skip-not-edi-implement-on-crons
Open

[19.0][IMP] edi_core_oca: skip exchange types w/o handler in cron domains#273
HviorForgeFlow wants to merge 2 commits into
OCA:19.0from
ForgeFlow:19.0-imp-edi_core_oca-skip-not-edi-implement-on-crons

Conversation

@HviorForgeFlow
Copy link
Copy Markdown
Member

Noticed while developing that when a exchange type is not linked to a handler and the EDINotImplementedError is raised, a DB rollback takes places undoing all previous work.

To ensure that skipping not handled exchanges does not break anything outside the cron scope I had to slightly change the exchange_generate_send method.

CC @etobella @simahawk @ForgeFlow

@OCA-git-bot
Copy link
Copy Markdown
Contributor

Hi @etobella, @simahawk,
some modules you are maintaining are being modified, check this out!

@OCA-git-bot OCA-git-bot added mod:edi_core_oca Module edi_core_oca series:19.0 mod:edi_queue_oca Module edi_queue_oca labels May 12, 2026
@simahawk
Copy link
Copy Markdown
Contributor

Wondering: why is it possible to handle an exc type w/o handler? It should be validated beforehand...

We should make specific validators required based on the direction.
And maybe improve _$direction_new_records_domain.

@HviorForgeFlow HviorForgeFlow force-pushed the 19.0-imp-edi_core_oca-skip-not-edi-implement-on-crons branch from 11c86d7 to 960d553 Compare May 16, 2026 07:59
@OCA-git-bot OCA-git-bot added the mod:edi_purchase_oca Module edi_purchase_oca label May 16, 2026
@HviorForgeFlow HviorForgeFlow force-pushed the 19.0-imp-edi_core_oca-skip-not-edi-implement-on-crons branch 2 times, most recently from 8d1870f to c20e67c Compare May 16, 2026 08:04
@OCA-git-bot OCA-git-bot removed mod:edi_purchase_oca Module edi_purchase_oca mod:edi_queue_oca Module edi_queue_oca labels May 16, 2026
@HviorForgeFlow
Copy link
Copy Markdown
Member Author

Wondering: why is it possible to handle an exc type w/o handler? It should be validated beforehand...

We should make specific validators required based on the direction. And maybe improve _$direction_new_records_domain.

That makes more sense, cleaner implementation, thanks for the advice

@HviorForgeFlow HviorForgeFlow force-pushed the 19.0-imp-edi_core_oca-skip-not-edi-implement-on-crons branch from c20e67c to bcb249e Compare May 18, 2026 06:56
@OCA-git-bot OCA-git-bot added the mod:edi_queue_oca Module edi_queue_oca label May 18, 2026
@HviorForgeFlow HviorForgeFlow force-pushed the 19.0-imp-edi_core_oca-skip-not-edi-implement-on-crons branch from bcb249e to 9abf705 Compare May 18, 2026 07:03
@HviorForgeFlow HviorForgeFlow force-pushed the 19.0-imp-edi_core_oca-skip-not-edi-implement-on-crons branch from 9abf705 to 4db716b Compare May 18, 2026 07:19
@HviorForgeFlow HviorForgeFlow force-pushed the 19.0-imp-edi_core_oca-skip-not-edi-implement-on-crons branch from 4db716b to 2134f83 Compare May 18, 2026 07:21
@HviorForgeFlow HviorForgeFlow changed the title [19.0][IMP] edi_core_oca: gracefully handle EDINotImplementedError to prevent batch failures on crons [19.0][IMP] edi_core_oca: skip exchange types w/o handler in cron domains May 18, 2026
@HviorForgeFlow
Copy link
Copy Markdown
Member Author

@simahawk it follows your suggested approach

@OCA-git-bot
Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@simahawk
Copy link
Copy Markdown
Contributor

@HviorForgeFlow I think you miss the part "specific validators required based on the direction."
Now that I see the change I'm not really a big fan of just the domain fix. Sorry 😇

What about adding validation and fixing the data the you have?
I mean, an exc type that has direction "output" and has no "generate" or "send" handler is definitely broken.
I'd rather:

  • add validation on the exc type form (make some fields required based on direction)
  • add an api.constraint

WDYT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants