mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-15 11:09:17 +00:00
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:
@@ -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
|
||||
|
||||
@@ -332,4 +332,4 @@ cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
|
||||
doctype: 'Delivery Note'
|
||||
}
|
||||
cur_frm.cscript.notify(doc, args);
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -230,3 +230,5 @@ cur_frm.cscript.validate_items = function(doc) {
|
||||
validated = false;
|
||||
}
|
||||
}
|
||||
|
||||
cur_frm.fields_dict.customer.get_query = erpnext.utils.customer_query;
|
||||
Reference in New Issue
Block a user