Description
SidePanelLayout.vue passes :onCreate="field.create" to the <Link> component (line 194), but never auto-assigns field.create for Link fields. This means the "Create New" button in Link field dropdowns only appears when field.create is explicitly set by the parent page (e.g., the address field in Organization.vue).
In contrast, Field.vue (used by FieldLayout in modals like OrganizationModal) has auto-create logic that works for all Link fields:
// Field.vue — auto-create for every Link field (non-User)
if (field.fieldtype === 'Link' && field.options !== 'User') {
if (!field.create) {
field.create = (value, close) => {
const callback = (d) => {
if (d) fieldChange(d.name, field)
}
createDocument(field.options, value, close, callback)
}
}
}
SidePanelLayout.vue has no equivalent logic.
Steps to reproduce
- Add a custom Link field to CRM Organization (e.g., linking to a custom DocType)
- Open an existing organization (sidepanel view, rendered by
SidePanelLayout)
- Click the Link field dropdown → no "Create New" button
- Now open the "New Organization" modal (rendered by
FieldLayout → Field.vue) → "Create New" button IS shown for the same field
Expected behavior
"Create New" button should appear in Link field dropdowns in both the sidepanel view and the modal, consistently.
Affected component
frontend/src/components/SidePanelLayout.vue — needs the same auto-create logic that frontend/src/components/FieldLayout/Field.vue already has.
Environment
- FCRM v1.76.0
- Frappe v16.25.0
Description
SidePanelLayout.vuepasses:onCreate="field.create"to the<Link>component (line 194), but never auto-assignsfield.createfor Link fields. This means the "Create New" button in Link field dropdowns only appears whenfield.createis explicitly set by the parent page (e.g., theaddressfield inOrganization.vue).In contrast,
Field.vue(used byFieldLayoutin modals likeOrganizationModal) has auto-create logic that works for all Link fields:SidePanelLayout.vuehas no equivalent logic.Steps to reproduce
SidePanelLayout)FieldLayout→Field.vue) → "Create New" button IS shown for the same fieldExpected behavior
"Create New" button should appear in Link field dropdowns in both the sidepanel view and the modal, consistently.
Affected component
frontend/src/components/SidePanelLayout.vue— needs the same auto-create logic thatfrontend/src/components/FieldLayout/Field.vuealready has.Environment