commified item_code query

This commit is contained in:
Rushabh Mehta
2013-01-07 17:03:11 +05:30
parent 523aec499a
commit 143ea718c3
10 changed files with 78 additions and 52 deletions

View File

@@ -174,10 +174,9 @@ var calculate_total = function(doc) {
cur_frm.fields_dict['item'].get_query = function(doc) {
return 'SELECT DISTINCT `tabItem`.`name`, `tabItem`.description FROM `tabItem` \
WHERE is_manufactured_item = "Yes" and (IFNULL(`tabItem`.`end_of_life`,"") = "" OR \
`tabItem`.`end_of_life` = "0000-00-00" OR `tabItem`.`end_of_life` > NOW()) AND \
`tabItem`.`%(key)s` like "%s" ORDER BY `tabItem`.`name` LIMIT 50';
return return erpnext.queries.item({
'ifnull(tabItem.is_manufactured_item, "No")': 'Yes'
})
}
cur_frm.fields_dict['project_name'].get_query = function(doc, dt, dn) {

View File

@@ -45,12 +45,9 @@ cur_frm.cscript.download_materials_required = function(doc, cdt, cdn) {
}
cur_frm.fields_dict['pp_details'].grid.get_field('item_code').get_query = function(doc) {
return 'SELECT DISTINCT `tabItem`.`name`,`tabItem`.`item_name` \
FROM `tabItem` WHERE `tabItem`.is_pro_applicable = "Yes" \
AND (IFNULL(`tabItem`.`end_of_life`,"") = "" \
OR `tabItem`.`end_of_life`="0000-00-00" OR `tabItem`.`end_of_life` > NOW()) \
AND tabItem.%(key)s like "%s" \
ORDER BY `tabItem`.`name` LIMIT 50';
return erpnext.queries.item({
'ifnull(tabItem.is_pro_applicable, "No")': 'Yes'
});
}
cur_frm.fields_dict['pp_details'].grid.get_field('bom_no').get_query = function(doc) {