mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-08 15:42:52 +00:00
fields disables in account doctype
This commit is contained in:
@@ -36,6 +36,10 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
|||||||
cur_frm.toggle_display(['account_type', 'master_type', 'master_name', 'freeze_account',
|
cur_frm.toggle_display(['account_type', 'master_type', 'master_name', 'freeze_account',
|
||||||
'credit_days', 'credit_limit', 'tax_rate'], doc.group_or_ledger=='Ledger')
|
'credit_days', 'credit_limit', 'tax_rate'], doc.group_or_ledger=='Ledger')
|
||||||
|
|
||||||
|
// disable fields
|
||||||
|
cur_frm.toggle_enable(['account_name', 'debit_or_credit', 'group_or_ledger',
|
||||||
|
'is_pl_account', 'company'], false);
|
||||||
|
|
||||||
// read-only for root accounts
|
// read-only for root accounts
|
||||||
root_acc = ['Application of Funds (Assets)','Expenses','Income','Source of Funds (Liabilities)'];
|
root_acc = ['Application of Funds (Assets)','Expenses','Income','Source of Funds (Liabilities)'];
|
||||||
if(in_list(root_acc, doc.account_name)) {
|
if(in_list(root_acc, doc.account_name)) {
|
||||||
@@ -45,7 +49,7 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
|||||||
// credit days and type if customer or supplier
|
// credit days and type if customer or supplier
|
||||||
cur_frm.set_intro(null);
|
cur_frm.set_intro(null);
|
||||||
cur_frm.toggle_display(['credit_days', 'credit_limit'],
|
cur_frm.toggle_display(['credit_days', 'credit_limit'],
|
||||||
in_list(['Customer', 'Supplier'], doc.master_type))
|
in_list(['Customer', 'Supplier'], doc.master_type));
|
||||||
|
|
||||||
// hide tax_rate
|
// hide tax_rate
|
||||||
cur_frm.cscript.account_type(doc, cdt, cdn);
|
cur_frm.cscript.account_type(doc, cdt, cdn);
|
||||||
@@ -55,6 +59,12 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cur_frm.cscript.master_type = function(doc, cdt, cdn) {
|
||||||
|
cur_frm.toggle_display(['credit_days', 'credit_limit', 'master_name'],
|
||||||
|
in_list(['Customer', 'Supplier'], doc.master_type));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Fetch parent details
|
// Fetch parent details
|
||||||
// -----------------------------------------
|
// -----------------------------------------
|
||||||
cur_frm.add_fetch('parent_account', 'debit_or_credit', 'debit_or_credit');
|
cur_frm.add_fetch('parent_account', 'debit_or_credit', 'debit_or_credit');
|
||||||
|
|||||||
Reference in New Issue
Block a user