fix: Usability fixes in accountng dimensions

This commit is contained in:
deepeshgarg007 2019-07-15 18:21:05 +05:30
parent 1cc46c06b0
commit 2093ffc15b

View File

@ -41,10 +41,10 @@ frappe.ui.form.on('Accounting Dimension', {
document_type: function(frm) {
frm.set_value('label', frm.doc.document_type);
frm.set_value('fieldname', frappe.scrub(frm.doc.document_type));
frm.set_value('fieldname', frappe.model.scrub(frm.doc.document_type));
frappe.db.get_value('Accounting Dimension', {'document_type': frm.doc.document_type}, 'document_type', (r) => {
if (r.document_type) {
if (r && r.document_type) {
frm.set_df_property('document_type', 'description', "Document type is already set as dimension");
}
});