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:
Shariq Ansari 2025-05-15 01:19:12 +05:30 committed by GitHub
commit 1f2eef4f14
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 19 additions and 18 deletions

View File

@ -38,9 +38,9 @@
/>
<div v-if="preview" class="flex flex-1 flex-col border rounded">
<SidePanelLayout
v-model="data"
:sections="tabs.data[0].sections"
:doctype="_doctype"
docname=""
:preview="true"
v-slot="{ section }"
>

View File

@ -1,6 +1,6 @@
<template>
<div
v-if="!document.get.loading"
v-if="!document.get?.loading"
class="sections flex flex-col overflow-y-auto"
>
<template v-for="(section, i) in _sections" :key="section.name">
@ -412,11 +412,18 @@ const { getFormattedPercent, getFormattedFloat, getFormattedCurrency } =
const { isManager, getUser } = usersStore()
const emit = defineEmits(['update', 'reload'])
const emit = defineEmits(['reload'])
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(() => {
if (!props.sections?.length) return []
@ -470,6 +477,8 @@ function parsedField(field) {
}
async function fieldChange(value, df) {
if (props.preview) return
document.doc[df.fieldname] = value
await triggerOnChange(df.fieldname)

View File

@ -121,10 +121,9 @@
class="flex flex-1 flex-col justify-between overflow-hidden"
>
<SidePanelLayout
v-model="contact.data"
:sections="sections.data"
doctype="Contact"
@update="updateField"
:docname="contact.data.name"
@reload="sections.reload"
/>
</div>

View File

@ -133,7 +133,6 @@
:addContact="addContact"
doctype="CRM Deal"
:docname="deal.data.name"
@update="updateField"
@reload="sections.reload"
>
<template #actions="{ section }">

View File

@ -185,7 +185,6 @@
:sections="sections.data"
doctype="CRM Lead"
:docname="lead.data.name"
@update="updateField"
@reload="sections.reload"
/>
</div>

View File

@ -130,10 +130,9 @@
class="flex flex-1 flex-col justify-between overflow-hidden"
>
<SidePanelLayout
v-model="contact.data"
:sections="sections.data"
doctype="Contact"
@update="updateField"
:docname="contact.data.name"
@reload="sections.reload"
/>
</div>

View File

@ -62,10 +62,9 @@
class="flex flex-1 flex-col justify-between overflow-hidden"
>
<SidePanelLayout
v-model="deal.data"
:sections="sections.data"
doctype="CRM Deal"
@update="updateField"
:docname="deal.data.name"
@reload="sections.reload"
>
<template #actions="{ section }">

View File

@ -67,10 +67,9 @@
class="flex flex-1 flex-col justify-between overflow-hidden"
>
<SidePanelLayout
v-model="lead.data"
:sections="sections.data"
doctype="CRM Lead"
@update="updateField"
:docname="lead.data.name"
@reload="sections.reload"
/>
</div>

View File

@ -112,10 +112,9 @@
class="flex flex-1 flex-col justify-between overflow-hidden"
>
<SidePanelLayout
v-model="organization.doc"
:sections="sections.data"
doctype="CRM Organization"
@update="updateField"
:docname="organization.doc.name"
@reload="sections.reload"
/>
</div>

View File

@ -106,10 +106,9 @@
class="flex flex-1 flex-col justify-between overflow-hidden"
>
<SidePanelLayout
v-model="organization.doc"
:sections="sections.data"
doctype="CRM Organization"
@update="updateField"
:docname="organization.doc.name"
@reload="sections.reload"
/>
</div>