Merge pull request #14051 from shreyashah115/min-fix

[Fix] Supplier Doctype
This commit is contained in:
rohitwaghchaure 2018-05-15 17:55:32 +05:30 committed by GitHub
commit 0e47837dab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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);
}
}
});