fix: linting
This commit is contained in:
parent
1f9b03345d
commit
9e9ea96582
@ -5,13 +5,13 @@ frappe.ui.form.on('Accounting Dimension Filter', {
|
|||||||
onload: function(frm) {
|
onload: function(frm) {
|
||||||
frappe.db.get_list('Accounting Dimension',
|
frappe.db.get_list('Accounting Dimension',
|
||||||
{fields: ['name']}).then((res) => {
|
{fields: ['name']}).then((res) => {
|
||||||
let options = ['Cost Center', 'Project'];
|
let options = ['Cost Center', 'Project'];
|
||||||
|
|
||||||
res.forEach((dimension) => {
|
res.forEach((dimension) => {
|
||||||
options.push(dimension.name);
|
options.push(dimension.name);
|
||||||
});
|
});
|
||||||
|
|
||||||
frm.set_df_property('accounting_dimension', 'options', options);
|
frm.set_df_property('accounting_dimension', 'options', options);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -44,7 +44,6 @@ def get_dimension_filter_map():
|
|||||||
""", as_dict=1)
|
""", as_dict=1)
|
||||||
|
|
||||||
dimension_filter_map = {}
|
dimension_filter_map = {}
|
||||||
account_filter_map = {}
|
|
||||||
|
|
||||||
for f in filters:
|
for f in filters:
|
||||||
if f.accounting_dimension in ('Cost Center', 'Project'):
|
if f.accounting_dimension in ('Cost Center', 'Project'):
|
||||||
|
@ -112,7 +112,7 @@ frappe.ui.form.on('Payroll Entry', {
|
|||||||
"company": frm.doc.company
|
"company": frm.doc.company
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
payroll_frequency: function (frm) {
|
payroll_frequency: function (frm) {
|
||||||
|
@ -134,7 +134,7 @@ $.extend(erpnext.queries, {
|
|||||||
'account': account,
|
'account': account,
|
||||||
'company': company
|
'company': company
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
frappe.provide('frappe.ui.form');
|
frappe.provide('frappe.ui.form');
|
||||||
|
|
||||||
let default_dimensions = {};
|
let default_dimensions = {};
|
||||||
|
|
||||||
let doctypes_with_dimensions = ["GL Entry", "Sales Invoice", "Purchase Invoice", "Payment Entry", "Asset",
|
let doctypes_with_dimensions = ["GL Entry", "Sales Invoice", "Purchase Invoice", "Payment Entry", "Asset",
|
||||||
@ -34,7 +33,7 @@ doctypes_with_dimensions.forEach((doctype) => {
|
|||||||
parent_fields.push(df.fieldname);
|
parent_fields.push(df.fieldname);
|
||||||
} else if (df.fieldtype === 'Table') {
|
} else if (df.fieldtype === 'Table') {
|
||||||
setup_child_filters(frm, df.options, df.fieldname, dimension['fieldname']);
|
setup_child_filters(frm, df.options, df.fieldname, dimension['fieldname']);
|
||||||
};
|
}
|
||||||
|
|
||||||
setup_account_filters(frm, dimension['fieldname'], parent_fields);
|
setup_account_filters(frm, dimension['fieldname'], parent_fields);
|
||||||
});
|
});
|
||||||
@ -90,7 +89,7 @@ let copy_dimension = function(frm, cdt, cdn, fieldname) {
|
|||||||
let row = frappe.get_doc(cdt, cdn);
|
let row = frappe.get_doc(cdt, cdn);
|
||||||
frm.script_manager.copy_from_first_row(fieldname, row, [dimension['fieldname']]);
|
frm.script_manager.copy_from_first_row(fieldname, row, [dimension['fieldname']]);
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
let setup_child_filters = function(frm, doctype, parentfield, dimension) {
|
let setup_child_filters = function(frm, doctype, parentfield, dimension) {
|
||||||
let fields = [];
|
let fields = [];
|
||||||
@ -107,10 +106,10 @@ let setup_child_filters = function(frm, doctype, parentfield, dimension) {
|
|||||||
return erpnext.queries.get_filtered_dimensions(row, fields, dimension, doc.company);
|
return erpnext.queries.get_filtered_dimensions(row, fields, dimension, doc.company);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
let setup_account_filters = function(frm, dimension, fields) {
|
let setup_account_filters = function(frm, dimension, fields) {
|
||||||
frm.set_query(dimension, function(doc) {
|
frm.set_query(dimension, function(doc) {
|
||||||
return erpnext.queries.get_filtered_dimensions(doc, fields, dimension, doc.company);
|
return erpnext.queries.get_filtered_dimensions(doc, fields, dimension, doc.company);
|
||||||
});
|
});
|
||||||
}
|
};
|
Loading…
x
Reference in New Issue
Block a user