What is the client side event that listens to this function?
I use doc.notify_update in Python.
How to listen to the event raised by doc.notify_update on the client side?
ankush
July 29, 2022, 9:13am
2
It publishes doc_update
and list_update
events. What you want to do with it is totally up to you, implementation and one example:
def notify_update(self):
"""Publish realtime that the current document is modified"""
if frappe.flags.in_patch:
return
frappe.publish_realtime(
"doc_update",
{"modified": self.modified, "doctype": self.doctype, "name": self.name},
doctype=self.doctype,
docname=self.name,
after_commit=True,
)
if (
not self.meta.get("read_only")
and not self.meta.get("issingle")
and not self.meta.get("istable")
):
data = {"doctype": self.doctype, "name": self.name, "user": frappe.session.user}
frappe.publish_realtime("list_update", data, after_commit=True)
Thanks a lot for your reply, I will try it.
Thx again.