diff --git a/frontend/src/data/document.js b/frontend/src/data/document.js index 67302549..bd412a44 100644 --- a/frontend/src/data/document.js +++ b/frontend/src/data/document.js @@ -98,14 +98,14 @@ export function useDocument(doctype, docname) { async function triggerOnLoad() { const handler = async function () { - await this.onLoad?.() + await (this.onLoad?.() || this.on_load?.() || this.onload?.()) } await trigger(handler) } async function triggerOnSave() { const handler = async function () { - await this.onSave?.() + await (this.onSave?.() || this.on_save?.()) } await trigger(handler) } @@ -164,7 +164,7 @@ export function useDocument(doctype, docname) { async function triggerOnCreateLead() { const args = Array.from(arguments) const handler = async function () { - await this.on_create_lead?.(...args) + await (this.onCreateLead?.(...args) || this.on_create_lead?.(...args)) } await trigger(handler) } @@ -172,7 +172,8 @@ export function useDocument(doctype, docname) { async function triggerConvertToDeal() { const args = Array.from(arguments) const handler = async function () { - await this.convert_to_deal?.(...args) + await (this.convertToDeal?.(...args) || + this.on_convert_to_deal?.(...args)) } await trigger(handler) }