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:
commit
c8f7f9552b
@ -19,6 +19,7 @@
|
|||||||
v-if="showCallLogModal"
|
v-if="showCallLogModal"
|
||||||
v-model="showCallLogModal"
|
v-model="showCallLogModal"
|
||||||
:data="callLog"
|
:data="callLog"
|
||||||
|
:referenceDoc="referenceDoc"
|
||||||
:options="{ afterInsert: () => activities.reload() }"
|
:options="{ afterInsert: () => activities.reload() }"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
@ -87,10 +88,12 @@ function showNote(n) {
|
|||||||
// Call Logs
|
// Call Logs
|
||||||
const showCallLogModal = ref(false)
|
const showCallLogModal = ref(false)
|
||||||
const callLog = ref({})
|
const callLog = ref({})
|
||||||
|
const referenceDoc = ref({})
|
||||||
|
|
||||||
function createCallLog() {
|
function createCallLog() {
|
||||||
let doctype = props.doctype
|
let doctype = props.doctype
|
||||||
let docname = props.doc.data?.name
|
let docname = props.doc.data?.name
|
||||||
|
referenceDoc.value = { ...props.doc.data }
|
||||||
callLog.value = {
|
callLog.value = {
|
||||||
reference_doctype: doctype,
|
reference_doctype: doctype,
|
||||||
reference_docname: docname,
|
reference_docname: docname,
|
||||||
|
|||||||
@ -69,6 +69,10 @@ const props = defineProps({
|
|||||||
type: Object,
|
type: Object,
|
||||||
default: () => ({}),
|
default: () => ({}),
|
||||||
},
|
},
|
||||||
|
referenceDoc: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({}),
|
||||||
|
},
|
||||||
options: {
|
options: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: {
|
default: {
|
||||||
@ -141,7 +145,7 @@ async function createCallLog() {
|
|||||||
telephony_medium: 'Manual',
|
telephony_medium: 'Manual',
|
||||||
})
|
})
|
||||||
|
|
||||||
await triggerOnBeforeCreate?.()
|
await triggerOnBeforeCreate?.(props.referenceDoc)
|
||||||
await _createCallLog.submit({
|
await _createCallLog.submit({
|
||||||
doc: callLog.doc,
|
doc: callLog.doc,
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user