Merge pull request #20884 from deepeshgarg007/first_row_dimension

fix: Acccounting Dimension disappearing in first row after refresh
This commit is contained in:
Deepesh Garg 2020-03-09 22:47:25 +05:30 committed by GitHub
commit 74d4e9e4ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,11 +35,13 @@ erpnext.doctypes_with_dimensions.forEach((doctype) => {
}
}
if (frm.doc.items && frm.doc.items.length) {
if (frm.doc.items && frm.doc.items.length && frm.doc.docstatus === 0
&& (!frm.doc.items[0][dimension['fieldname']])) {
frm.doc.items[0][dimension['fieldname']] = erpnext.default_dimensions[frm.doc.company][dimension['document_type']];
}
if (frm.doc.accounts && frm.doc.accounts.length) {
if (frm.doc.accounts && frm.doc.accounts.length && frm.doc.docstatus === 0
&& (!frm.doc.items[0][dimension['fieldname']])) {
frm.doc.accounts[0][dimension['fieldname']] = erpnext.default_dimensions[frm.doc.company][dimension['document_type']];
}
}