Skip to content

[19.0] [IMP] edi_core_oca: scheduled edi.configuration triggers - #333

Open
ivantodorovich wants to merge 1 commit into
OCA:19.0from
camptocamp:19.0-imp-edi_core_oca-cron-triggers
Open

[19.0] [IMP] edi_core_oca: scheduled edi.configuration triggers#333
ivantodorovich wants to merge 1 commit into
OCA:19.0from
camptocamp:19.0-imp-edi_core_oca-cron-triggers

Conversation

@ivantodorovich

Copy link
Copy Markdown
Contributor

Add on_cron_hourly and on_cron_daily triggers, fired by scheduled actions. They carry no originating record, so each configuration resolves its own targets: a global one runs once, any other runs against the records linked to it through a many2many on its model.

@OCA-git-bot

Copy link
Copy Markdown
Contributor

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

@ivantodorovich ivantodorovich changed the title [IMP] edi_core_oca: scheduled edi.configuration triggers [19.0] [IMP] edi_core_oca: scheduled edi.configuration triggers Aug 31, 2026
@ivantodorovich
ivantodorovich marked this pull request as ready for review August 31, 2026 20:24

@simahawk simahawk left a comment

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.

Nice addition. Very handy to export batches or reports with a given cadence.
Can you please document it in CONFIGURE.md?

Questions:

  1. no idempotency: if someone runs the cron again, the configs will be executed again -> wouldn't be worth to mention it in an info box?
  2. despite there's no dependency addition I wonder if we want to host this feature in core. In particular I wonder if we shouldn't simply supply the cron method and leave implementers the freedom to create specific triggers and crons. All in all what makes it work is the trigger code, no matter what it is.


self.edi_configuration._cron_run_by_trigger("on_cron_hourly")

self.assertEqual(

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.

I would use RecordCapturer. Not a blocker.

@ivantodorovich

ivantodorovich commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @simahawk !

Can you please document it in CONFIGURE.md?

Sure thing, I'll update asap

  1. no idempotency: if someone runs the cron again, the configs will be executed again -> wouldn't be worth to mention it in an info box?

An info box in the edi.configuration page?
The problem is how to identify scheduled action triggers in order to display/hide this box. A naive solution would be by name (startswith on_cron), but it's not technically correct.. people have the freedom to implement their own scheduled action triggers and use whatever name they want

  1. despite there's no dependency addition I wonder if we want to host this feature in core. In particular I wonder if we shouldn't simply supply the cron method and leave implementers the freedom to create specific triggers and crons. All in all what makes it work is the trigger code, no matter what it is.

Yes that's the idea, implementers have the freedom to create new triggers and crons, but I figured we can already supply an hourly and daily cron triggers to serve as implementation example whilst covering the most common usage

@ivantodorovich
ivantodorovich force-pushed the 19.0-imp-edi_core_oca-cron-triggers branch from 1c59c76 to 90558e1 Compare September 1, 2026 12:14
@ivantodorovich

Copy link
Copy Markdown
Contributor Author

it's ready

@ivantodorovich
ivantodorovich force-pushed the 19.0-imp-edi_core_oca-cron-triggers branch from 90558e1 to 15eef6d Compare September 2, 2026 14:58
Add on_cron_hourly and on_cron_daily triggers, fired by scheduled actions
of the same period. They carry no originating record, so each configuration
resolves its own targets: a global one runs once, any other runs against the
records linked to it through a many2many on its model.

That lookup is now shared with action_view_partners, which went through the
relation tables directly and assumed every many2many linking res.partner to
edi.configuration named its columns partner_id and conf_id.
@ivantodorovich
ivantodorovich force-pushed the 19.0-imp-edi_core_oca-cron-triggers branch from 15eef6d to e0715cd Compare September 2, 2026 15:04
@ivantodorovich

Copy link
Copy Markdown
Contributor Author

@simahawk changed again: crons and triggers are demo data only, not shipped directly

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