Merge pull request #988 from shariquerik/call-log-on-before-create

This commit is contained in:
Shariq Ansari 2025-06-30 20:06:01 +05:30 committed by GitHub
commit 7c307a9134
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,
})