Skip to content

[17.0]edi_oca: configurable per-stage related-record notifications + form cleanup#317

Open
GuillemCForgeFlow wants to merge 2 commits into
OCA:17.0from
ForgeFlow:17.0-imp-reorg_exch_type_ui_toggle_notify
Open

[17.0]edi_oca: configurable per-stage related-record notifications + form cleanup#317
GuillemCForgeFlow wants to merge 2 commits into
OCA:17.0from
ForgeFlow:17.0-imp-reorg_exch_type_ui_toggle_notify

Conversation

@GuillemCForgeFlow

Copy link
Copy Markdown
  1. Configurable chatter notifications per stage. Adds four per-type toggles on edi.exchange.type — notify_rel_rec_on_generate / send / process / receive (all default True) — controlling whether a note is posted on the related record's chatter for each exchange stage. This lets a type stay silent on, say, generate while still logging send and process, instead of always posting on every stage.
  2. Exchange-type form reorganization. Moves the configuration fields out of the header into a dedicated Configuration notebook page, grouped by nature (File, Automation, Acknowledgement, Related-record notifications, Scope). The header keeps only the base identity params (backend, backend type, code, direction).

How

  1. The gate lives in the single funnel edi.exchange.record._notify_related_record, which now takes the stage action and consults edi.exchange.type._notify_related_on(action). generate/send/receive thread it via notify_action_complete; process via _notify_done/_notify_error. Stages without a toggle (e.g. ACK) keep notifying.
  2. Defaults preserve the previous always-notify behavior, so this is backward compatible (no migration needed — new columns default True).

Tests

Adds coverage in test_backend_output.py: with notify_rel_rec_on_generate = False, generate posts no note while send still does; default behavior unchanged.

cc @ForgeFlow

@OCA-git-bot

Copy link
Copy Markdown
Contributor

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

Comment thread edi_oca/models/edi_exchange_type.py Outdated
Comment thread edi_oca/models/edi_exchange_type.py Outdated
Comment on lines -42 to -65
<group name="config">
<field name="exchange_filename_pattern" />
<field name="exchange_filename_sequence_id" />
<field name="exchange_file_ext" />
<field name="exchange_file_auto_generate" />
<field name="ack_type_id" />
<field name="ack_for_type_ids" widget="many2many_tags" />
<field name="partner_ids" widget="many2many_tags" />
<field name="job_channel_id" />
<field name="quick_exec" />
<field name="encoding" />
<field
name="encoding_out_error_handler"
invisible="direction == 'input'"
/>
<field
name="encoding_in_error_handler"
invisible="direction == 'output'"
/>
<field
name="allow_empty_files_on_receive"
invisible="direction == 'output'"
/>
</group>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please don't do this: this architecture might be inherited and customized by third-party modules, and this change might break the view's inheritance mechanism (even though I personally agree a page in the notebook yields to a better UX).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I see, thanks for pointing out. what I've done now is still keep the name="config" attribute on the main group in the view. I understand there's still a chance that will can break current installations. do you think we should perhaps note this to be done in the next migration?

Move the exchange-type configuration fields out of the header and into a
dedicated 'Configuration' notebook page, grouped by nature (File, Automation,
Acknowledgement, Scope). The header keeps only the base identity params
(backend, backend type, code, direction).
Add per-type toggles (notify_rel_rec_on_generate/send/process/receive, default
True) on edi.exchange.type controlling whether a chatter note is posted on the
related record for each exchange stage. The gate lives in the single funnel
edi.exchange.record._notify_related_record, which now takes the stage action and
consults edi.exchange.type._notify_related_on; generate/send/receive thread it
via notify_action_complete, process via _notify_done/_notify_error. Defaults
preserve the previous always-notify behavior.
@GuillemCForgeFlow GuillemCForgeFlow force-pushed the 17.0-imp-reorg_exch_type_ui_toggle_notify branch from 47cb50b to 0ce38b4 Compare July 10, 2026 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants