fix: Check for custom dimensions

This commit is contained in:
Deepesh Garg 2021-01-04 14:23:31 +05:30
parent 23ab5c5cc0
commit a873ae0d9f

View File

@ -23,6 +23,7 @@ erpnext.accounts.dimensions = {
},
setup_filters(frm, doctype) {
if (this.accounting_dimensions) {
this.accounting_dimensions.forEach((dimension) => {
frappe.model.with_doctype(dimension['document_type'], () => {
let parent_fields = [];
@ -39,6 +40,7 @@ erpnext.accounts.dimensions = {
});
});
});
}
},
setup_child_filters(frm, doctype, parentfield, dimension) {
@ -91,7 +93,7 @@ erpnext.accounts.dimensions = {
},
copy_dimension_from_first_row(frm, cdt, cdn, fieldname) {
if (frappe.meta.has_field(frm.doctype, fieldname)) {
if (frappe.meta.has_field(frm.doctype, fieldname) && this.accounting_dimensions) {
this.accounting_dimensions.forEach((dimension) => {
let row = frappe.get_doc(cdt, cdn);
frm.script_manager.copy_from_first_row(fieldname, row, [dimension['fieldname']]);