Merge pull request #989 from frappe/mergify/bp/main-hotfix/pr-988

fix: get reference doc in onBeforeCreate hook of call log modal (backport #988)
This commit is contained in:
Shariq Ansari 2025-06-30 20:09:38 +05:30 committed by GitHub
commit c8f7f9552b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View File

@ -19,6 +19,7 @@
v-if="showCallLogModal"
v-model="showCallLogModal"
:data="callLog"
:referenceDoc="referenceDoc"
:options="{ afterInsert: () => activities.reload() }"
/>
</template>
@ -87,10 +88,12 @@ function showNote(n) {
// Call Logs
const showCallLogModal = ref(false)
const callLog = ref({})
const referenceDoc = ref({})
function createCallLog() {
let doctype = props.doctype
let docname = props.doc.data?.name
referenceDoc.value = { ...props.doc.data }
callLog.value = {
reference_doctype: doctype,
reference_docname: docname,

View File

@ -69,6 +69,10 @@ const props = defineProps({
type: Object,
default: () => ({}),
},
referenceDoc: {
type: Object,
default: () => ({}),
},
options: {
type: Object,
default: {
@ -141,7 +145,7 @@ async function createCallLog() {
telephony_medium: 'Manual',
})
await triggerOnBeforeCreate?.()
await triggerOnBeforeCreate?.(props.referenceDoc)
await _createCallLog.submit({
doc: callLog.doc,
})