fix: pass reference doc to call log modal to get reference doc in on before create

(cherry picked from commit aae7e0e36cf86f7be76fc9e6fcc22f57fd5b56e3)
This commit is contained in:
Shariq Ansari 2025-06-30 20:00:05 +05:30 committed by Mergify
parent 01b43747b8
commit a04b9f5a5e
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,
})