fix: add doctype, idx, parent, parenttype & parentfield in new grid row

This commit is contained in:
Shariq Ansari 2025-05-07 16:59:22 +05:30
parent 29894ffcca
commit 727d0a9acd
2 changed files with 6 additions and 0 deletions

View File

@ -417,6 +417,8 @@ const addRow = () => {
newRow.name = getRandom(10)
showRowList.value.push(false)
newRow['__islocal'] = true
newRow['idx'] = rows.value.length + 1
newRow['doctype'] = props.doctype
rows.value.push(newRow)
}

View File

@ -162,6 +162,10 @@ export function getScript(doctype, view = 'Form') {
return null
}
row.parent = row.parent || data.name
row.parentype = row.parenttype || data.doctype
row.parentfield = row.parentfield || parentField
return createDocProxy(row, instance)
}