[fix] get_query where options not mentioned
This commit is contained in:
parent
eddd4a1674
commit
d96bfaf6af
@ -124,6 +124,7 @@ cur_frm.cscript.convert_to_group = function(doc, cdt, cdn) {
|
|||||||
cur_frm.fields_dict['master_name'].get_query = function(doc) {
|
cur_frm.fields_dict['master_name'].get_query = function(doc) {
|
||||||
if (doc.master_type) {
|
if (doc.master_type) {
|
||||||
return {
|
return {
|
||||||
|
doctype: doc.master_type,
|
||||||
query: "accounts.doctype.account.account.get_master_name",
|
query: "accounts.doctype.account.account.get_master_name",
|
||||||
filters: { "master_type": doc.master_type }
|
filters: { "master_type": doc.master_type }
|
||||||
}
|
}
|
||||||
|
@ -36,11 +36,14 @@ cur_frm.fields_dict.voucher_no.get_query = function(doc) {
|
|||||||
// TO-do: check for pos, it should not come
|
// TO-do: check for pos, it should not come
|
||||||
if (!doc.account) msgprint("Please select Account first");
|
if (!doc.account) msgprint("Please select Account first");
|
||||||
else {
|
else {
|
||||||
query: "accounts.doctype.payment_to_invoice_matching_tool.payment_to_invoice_matching_tool.gl_entry_details",
|
return {
|
||||||
filters: {
|
doctype: doc.voucher_type,
|
||||||
"dt": doc.voucher_type,
|
query: "accounts.doctype.payment_to_invoice_matching_tool.payment_to_invoice_matching_tool.gl_entry_details",
|
||||||
"acc": doc.account,
|
filters: {
|
||||||
"account_type": doc.account_type
|
"dt": doc.voucher_type,
|
||||||
|
"acc": doc.account,
|
||||||
|
"account_type": doc.account_type
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -99,24 +99,20 @@ cur_frm.fields_dict['system_role'].get_query = function(doc) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Approving Role Trigger
|
|
||||||
// -----------------------
|
|
||||||
// cur_frm.fields_dict['approving_role'].get_query = function(doc) {
|
|
||||||
// return 'SELECT tabRole.name FROM tabRole WHERE tabRole.name not in ("Administrator","Guest","All") AND tabRole.%(key)s LIKE "%s" LIMIT 50'
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
// Master Name Trigger
|
// Master Name Trigger
|
||||||
// --------------------
|
// --------------------
|
||||||
cur_frm.fields_dict['master_name'].get_query = function(doc){
|
cur_frm.fields_dict['master_name'].get_query = function(doc){
|
||||||
if(doc.based_on == 'Customerwise Discount')
|
if(doc.based_on == 'Customerwise Discount')
|
||||||
return {
|
return {
|
||||||
|
doctype: "Customer",
|
||||||
filters:[
|
filters:[
|
||||||
['Customer', 'docstatus', '!=', 2]
|
['Customer', 'docstatus', '!=', 2]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
else if(doc.based_on == 'Itemwise Discount')
|
else if(doc.based_on == 'Itemwise Discount')
|
||||||
return {
|
return {
|
||||||
|
doctype: "Item",
|
||||||
query: "controllers.queries.item_query"
|
query: "controllers.queries.item_query"
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user