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-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,
|
||||
|
||||
@ -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,
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user