Merge pull request #819 from frappe/mergify/bp/main-hotfix/pr-818
fix: contact/organization page not loading (backport #818)
This commit is contained in:
commit
1f2eef4f14
@ -38,9 +38,9 @@
|
|||||||
/>
|
/>
|
||||||
<div v-if="preview" class="flex flex-1 flex-col border rounded">
|
<div v-if="preview" class="flex flex-1 flex-col border rounded">
|
||||||
<SidePanelLayout
|
<SidePanelLayout
|
||||||
v-model="data"
|
|
||||||
:sections="tabs.data[0].sections"
|
:sections="tabs.data[0].sections"
|
||||||
:doctype="_doctype"
|
:doctype="_doctype"
|
||||||
|
docname=""
|
||||||
:preview="true"
|
:preview="true"
|
||||||
v-slot="{ section }"
|
v-slot="{ section }"
|
||||||
>
|
>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
v-if="!document.get.loading"
|
v-if="!document.get?.loading"
|
||||||
class="sections flex flex-col overflow-y-auto"
|
class="sections flex flex-col overflow-y-auto"
|
||||||
>
|
>
|
||||||
<template v-for="(section, i) in _sections" :key="section.name">
|
<template v-for="(section, i) in _sections" :key="section.name">
|
||||||
@ -412,11 +412,18 @@ const { getFormattedPercent, getFormattedFloat, getFormattedCurrency } =
|
|||||||
|
|
||||||
const { isManager, getUser } = usersStore()
|
const { isManager, getUser } = usersStore()
|
||||||
|
|
||||||
const emit = defineEmits(['update', 'reload'])
|
const emit = defineEmits(['reload'])
|
||||||
|
|
||||||
const showSidePanelModal = ref(false)
|
const showSidePanelModal = ref(false)
|
||||||
|
|
||||||
const { document, triggerOnChange } = useDocument(props.doctype, props.docname)
|
let document = { doc: {} }
|
||||||
|
let triggerOnChange
|
||||||
|
|
||||||
|
if (props.docname) {
|
||||||
|
let d = useDocument(props.doctype, props.docname)
|
||||||
|
document = d.document
|
||||||
|
triggerOnChange = d.triggerOnChange
|
||||||
|
}
|
||||||
|
|
||||||
const _sections = computed(() => {
|
const _sections = computed(() => {
|
||||||
if (!props.sections?.length) return []
|
if (!props.sections?.length) return []
|
||||||
@ -470,6 +477,8 @@ function parsedField(field) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function fieldChange(value, df) {
|
async function fieldChange(value, df) {
|
||||||
|
if (props.preview) return
|
||||||
|
|
||||||
document.doc[df.fieldname] = value
|
document.doc[df.fieldname] = value
|
||||||
|
|
||||||
await triggerOnChange(df.fieldname)
|
await triggerOnChange(df.fieldname)
|
||||||
|
|||||||
@ -121,10 +121,9 @@
|
|||||||
class="flex flex-1 flex-col justify-between overflow-hidden"
|
class="flex flex-1 flex-col justify-between overflow-hidden"
|
||||||
>
|
>
|
||||||
<SidePanelLayout
|
<SidePanelLayout
|
||||||
v-model="contact.data"
|
|
||||||
:sections="sections.data"
|
:sections="sections.data"
|
||||||
doctype="Contact"
|
doctype="Contact"
|
||||||
@update="updateField"
|
:docname="contact.data.name"
|
||||||
@reload="sections.reload"
|
@reload="sections.reload"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -133,7 +133,6 @@
|
|||||||
:addContact="addContact"
|
:addContact="addContact"
|
||||||
doctype="CRM Deal"
|
doctype="CRM Deal"
|
||||||
:docname="deal.data.name"
|
:docname="deal.data.name"
|
||||||
@update="updateField"
|
|
||||||
@reload="sections.reload"
|
@reload="sections.reload"
|
||||||
>
|
>
|
||||||
<template #actions="{ section }">
|
<template #actions="{ section }">
|
||||||
|
|||||||
@ -185,7 +185,6 @@
|
|||||||
:sections="sections.data"
|
:sections="sections.data"
|
||||||
doctype="CRM Lead"
|
doctype="CRM Lead"
|
||||||
:docname="lead.data.name"
|
:docname="lead.data.name"
|
||||||
@update="updateField"
|
|
||||||
@reload="sections.reload"
|
@reload="sections.reload"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -130,10 +130,9 @@
|
|||||||
class="flex flex-1 flex-col justify-between overflow-hidden"
|
class="flex flex-1 flex-col justify-between overflow-hidden"
|
||||||
>
|
>
|
||||||
<SidePanelLayout
|
<SidePanelLayout
|
||||||
v-model="contact.data"
|
|
||||||
:sections="sections.data"
|
:sections="sections.data"
|
||||||
doctype="Contact"
|
doctype="Contact"
|
||||||
@update="updateField"
|
:docname="contact.data.name"
|
||||||
@reload="sections.reload"
|
@reload="sections.reload"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -62,10 +62,9 @@
|
|||||||
class="flex flex-1 flex-col justify-between overflow-hidden"
|
class="flex flex-1 flex-col justify-between overflow-hidden"
|
||||||
>
|
>
|
||||||
<SidePanelLayout
|
<SidePanelLayout
|
||||||
v-model="deal.data"
|
|
||||||
:sections="sections.data"
|
:sections="sections.data"
|
||||||
doctype="CRM Deal"
|
doctype="CRM Deal"
|
||||||
@update="updateField"
|
:docname="deal.data.name"
|
||||||
@reload="sections.reload"
|
@reload="sections.reload"
|
||||||
>
|
>
|
||||||
<template #actions="{ section }">
|
<template #actions="{ section }">
|
||||||
|
|||||||
@ -67,10 +67,9 @@
|
|||||||
class="flex flex-1 flex-col justify-between overflow-hidden"
|
class="flex flex-1 flex-col justify-between overflow-hidden"
|
||||||
>
|
>
|
||||||
<SidePanelLayout
|
<SidePanelLayout
|
||||||
v-model="lead.data"
|
|
||||||
:sections="sections.data"
|
:sections="sections.data"
|
||||||
doctype="CRM Lead"
|
doctype="CRM Lead"
|
||||||
@update="updateField"
|
:docname="lead.data.name"
|
||||||
@reload="sections.reload"
|
@reload="sections.reload"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -112,10 +112,9 @@
|
|||||||
class="flex flex-1 flex-col justify-between overflow-hidden"
|
class="flex flex-1 flex-col justify-between overflow-hidden"
|
||||||
>
|
>
|
||||||
<SidePanelLayout
|
<SidePanelLayout
|
||||||
v-model="organization.doc"
|
|
||||||
:sections="sections.data"
|
:sections="sections.data"
|
||||||
doctype="CRM Organization"
|
doctype="CRM Organization"
|
||||||
@update="updateField"
|
:docname="organization.doc.name"
|
||||||
@reload="sections.reload"
|
@reload="sections.reload"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -106,10 +106,9 @@
|
|||||||
class="flex flex-1 flex-col justify-between overflow-hidden"
|
class="flex flex-1 flex-col justify-between overflow-hidden"
|
||||||
>
|
>
|
||||||
<SidePanelLayout
|
<SidePanelLayout
|
||||||
v-model="organization.doc"
|
|
||||||
:sections="sections.data"
|
:sections="sections.data"
|
||||||
doctype="CRM Organization"
|
doctype="CRM Organization"
|
||||||
@update="updateField"
|
:docname="organization.doc.name"
|
||||||
@reload="sections.reload"
|
@reload="sections.reload"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user