Fixed bug when subtabs won't work in doctype with seperate name

This commit is contained in:
Ali 2024-12-05 14:36:14 +04:00
parent a77620953f
commit b0e7dcd8c0
1 changed files with 2 additions and 2 deletions

View File

@ -52,7 +52,7 @@ frappe.ui.form.Layout.prototype.setup_tab_events = function () {
const parentSubtabs = subtabs[parentTabName] || [];
parentSubtabs.forEach((subtabName) => {
const subtabElement = $(`.nav-item:contains(${subtabName})`);
const subtabContentId = `${currentDoctype.toLowerCase()}-${subtabName.toLowerCase().replace(/\s+/g, '_')}_tab`;
const subtabContentId = `${currentDoctype.toLowerCase().replace(/\s+/g, '-')}-${subtabName.toLowerCase().replace(/\s+/g, '_')}_tab`;
const subtabContent = $(`#${subtabContentId}`);
if (subtabElement.length) {
@ -66,7 +66,7 @@ frappe.ui.form.Layout.prototype.setup_tab_events = function () {
});
// Show the parent tab's content
const parentTabContentId = `${currentDoctype.toLowerCase()}-${parentTabName.toLowerCase().replace(/\s+/g, '_')}_tab`;
const parentTabContentId = `${currentDoctype.toLowerCase().replace(/\s+/g, '-')}-${parentTabName.toLowerCase().replace(/\s+/g, '_')}_tab`;
showTabContent(parentTabContentId);
// Recursively handle the parent tab