Fix Supplier Doctype

This commit is contained in:
Shreya 2018-05-15 17:43:50 +05:30
parent ec54cb1810
commit da5163da2f

View File

@ -4,6 +4,9 @@
frappe.ui.form.on("Supplier", {
setup: function (frm) {
frm.set_query('default_price_list', { 'buying': 1 });
if (frm.doc.__islocal == 1) {
frm.set_value("represents_company", "");
}
frm.set_query('account', 'accounts', function (doc, cdt, cdn) {
var d = locals[cdt][cdn];
return {
@ -45,4 +48,13 @@ frappe.ui.form.on("Supplier", {
erpnext.utils.set_party_dashboard_indicators(frm);
}
},
is_internal_supplier: function(frm) {
if (frm.doc.is_internal_supplier == 1) {
frm.toggle_reqd("represents_company", true);
}
else {
frm.toggle_reqd("represents_company", false);
}
}
});