added customer get_query to allow search based on customer name. also don't show name again if id naming is based on customer name and not series

This commit is contained in:
Anand Doshi
2012-11-21 18:02:22 +05:30
parent 009d3e1952
commit 93a35cab19
26 changed files with 89 additions and 16 deletions

View File

@@ -273,7 +273,7 @@ class DocType:
self.exc_list = []
for sle in sll:
# block if stock level goes negative on any date
if val_method != 'Moving Average' or flt(allow_negative_stock) == 0:
if (val_method != 'Moving Average') or (cint(allow_negative_stock) == 0):
if self.validate_negative_stock(cqty, sle):
cqty += sle['actual_qty']
continue

View File

@@ -332,4 +332,4 @@ cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
doctype: 'Delivery Note'
}
cur_frm.cscript.notify(doc, args);
}
}

View File

@@ -141,4 +141,7 @@ cur_frm.cscript.validate = function(doc,cdt,cdn){
cur_frm.fields_dict['ref_rate_details'].grid.onrowadd = function(doc, cdt, cdn){
locals[cdt][cdn].ref_currency = sys_defaults.currency;
refresh_field('ref_currency',cdn,'ref_rate_details');
}
}
cur_frm.fields_dict.item_customer_details.grid.get_field("customer_name").get_query =
erpnext.utils.customer_query;

View File

@@ -67,4 +67,6 @@ cur_frm.fields_dict['item_code'].get_query = function(doc,cdt,cdn) {
WHERE `tabItem`.`docstatus`!= 2 AND ifnull(`tabItem`.`has_serial_no`, "No") = "Yes" \
AND (ifnull(`tabItem`.`end_of_life`,"") = "" OR `tabItem`.`end_of_life` > NOW() OR `tabItem`.`end_of_life`="0000-00-00") \
AND `tabItem`.%(key)s LIKE "%s" ORDER BY `tabItem`.`name` ASC LIMIT 50';
}
}
cur_frm.fields_dict.customer.get_query = erpnext.utils.customer_query;

View File

@@ -230,3 +230,5 @@ cur_frm.cscript.validate_items = function(doc) {
validated = false;
}
}
cur_frm.fields_dict.customer.get_query = erpnext.utils.customer_query;