[New App] Extension to Frappe EventStream [v13]

Frappe added EventStreaming module recently in their v13 release. This enables a site to subscribe to another site for all document updates.

For example, forwarding all the Sales Invoices made on one site to be reflected on another site. This is great!

But what if we dont want to send over all the Sales Invoices ? What if you need to send only those invoices made by Customer A ?

We made a custom frappe app: GitHub - leam-tech/frappe_renovation_docsync

While making a Event Producer document instance on the Consumer site, we specify the conditions along with it. This allows Consumer specific conditions.

Conditions in Producer Document

We can even set conditions on Global level using the Event DocType Condition doctype. It can be used to set a single condition for all Consumers.

Implementation

This flowchart aims to provide a simple overview.

Flow

In order to get our customizations working with frappe’s system, 3 frappe functions had to be patched. You can find them patched here.

This allows us to send the consumer specific conditions table entries over for the Producer to accept.

This allows us to update the consumer specific conditions table entries over to the Producer

This allows us to filter/or be selective on what Event Update Log to send back to the Consumer

We chose to make a custom app instead of a PR because it is hard to get accepted by the frappe team. If you guys think this should be part of frappe itself, we will be happy to make a PR.

Please share your thoughts :wink:

If you are interested, you could check out some of our other apps:

Additionally, checkout renovation_core frappe app which includes useful features like FirebaseCloudMessaging and SMS Authentication

10 Likes

This should be a PR

I want this but because of the sensitive nature of this, I am reluctant to touch it if it not a PR

I specifically asked for this from the frappe team in this thread

Once again please send a PR

Good work

2 Likes

I have to agree completely that this should actually be a PR… the feature is really very important and I can imagine the Frappe team is already planning to add it soon

Good job… Cheers

2 Likes

I have started working on the PR to frappe, you can find it here:
https://github.com/frappe/frappe/pull/10868

5 Likes