Skip to content

[18.0][FIX] edi_core_oca: notify action completion based on exchange state#237

Open
Ricardoalso wants to merge 1 commit intoOCA:18.0from
camptocamp:fix_notify_action_complete
Open

[18.0][FIX] edi_core_oca: notify action completion based on exchange state#237
Ricardoalso wants to merge 1 commit intoOCA:18.0from
camptocamp:fix_notify_action_complete

Conversation

@Ricardoalso
Copy link
Contributor

@Ricardoalso Ricardoalso commented Feb 20, 2026

CI failing because of FakeModelLoader; addressing it in #238

EDIT
Cherry-picked the FakeModelLoader commit in here in order to let the CI run, but I will rebase it as soon the FakeModelLoader PR gets merged #238

@OCA-git-bot
Copy link
Contributor

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

@Ricardoalso Ricardoalso marked this pull request as draft February 20, 2026 13:51
Copy link
Member

@etobella etobella left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes sense

@Ricardoalso Ricardoalso marked this pull request as ready for review February 20, 2026 15:00
@Ricardoalso Ricardoalso force-pushed the fix_notify_action_complete branch from a04b068 to 01e9cef Compare February 20, 2026 16:02
@OCA-git-bot
Copy link
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
Contributor

@Ricardoalso pls rebase

@Ricardoalso Ricardoalso force-pushed the fix_notify_action_complete branch from 01e9cef to fc636a7 Compare February 25, 2026 14:47
}
)
exchange_record.notify_action_complete("generate", message=message)
if exchange_record.edi_exchange_state == "output_pending":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is correct. For instance, in this case, there won't be any notification for validate_ko.
A long time ago I refactored this part to always notify w/ notify_action_complete no matter what.
It doesn't not matter how it completes, it must always notify to trigger events or post a message somewhere.
What are you trying to solve in particular?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For line 145, I agree with your feedback; my change is incorrect in restricting notification.

his PR targets the same underlying issue referenced in PR #240. The goal was to avoid calling notify_action_complete on an exchange_record with a dead cursor. I split the PRs to keep things explicit, but introducing a raise for OperationalError or IntegrityError ensures that if a cursor dies, the function flow is interrupted, and neither notification nor downstream hooks are triggered.

Without exception handling, the flow would continue, notifications would be sent, and hooks would run—which is exactly what we wanted to prevent when encountering these database errors. If you see other scenarios or states where this might not be sufficient, I’m open to suggestions!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but if the errors are raised then you don't need this, am I wrong?

Copy link
Contributor Author

@Ricardoalso Ricardoalso Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If they are raised, there’s indeed no need, as notify_action_complete would not be reached.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants