[minor] fixes in queries and payment tool
diff --git a/erpnext/accounts/doctype/payment_tool/payment_tool.js b/erpnext/accounts/doctype/payment_tool/payment_tool.js
index 5904b99..dcf657a 100644
--- a/erpnext/accounts/doctype/payment_tool/payment_tool.js
+++ b/erpnext/accounts/doctype/payment_tool/payment_tool.js
@@ -90,7 +90,7 @@
"mode_of_payment": frm.doc.payment_mode,
"company": frm.doc.company
},
- callback: function(r, rt) {
+ callback: function(r, rt) {
if(r.message) {
cur_frm.set_value("payment_account", r.message['account']);
}
@@ -169,6 +169,10 @@
// validate against_voucher_type
frappe.ui.form.on("Payment Tool Detail", "against_voucher_no", function(frm, cdt, cdn) {
var row = locals[cdt][cdn];
+ if (!row.against_voucher_no) {
+ return;
+ }
+
frappe.call({
method: 'erpnext.accounts.doctype.payment_tool.payment_tool.get_against_voucher_amount',
args: {
@@ -233,4 +237,4 @@
$.each(["Company", "Party Type", "Party", "Received or Paid"], function(i, field) {
if(!doc[frappe.model.scrub(field)]) frappe.throw(__("Please select {0} first", [field]));
});
-}
\ No newline at end of file
+}
diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py
index 6c98202..a6bfa53 100644
--- a/erpnext/controllers/queries.py
+++ b/erpnext/controllers/queries.py
@@ -9,6 +9,7 @@
def get_filters_cond(doctype, filters, conditions):
if filters:
+ flt = filters
if isinstance(filters, dict):
filters = filters.items()
flt = []
diff --git a/erpnext/manufacturing/doctype/bom/bom.js b/erpnext/manufacturing/doctype/bom/bom.js
index f0eebb1..3bad2f0 100644
--- a/erpnext/manufacturing/doctype/bom/bom.js
+++ b/erpnext/manufacturing/doctype/bom/bom.js
@@ -147,9 +147,7 @@
cur_frm.fields_dict['items'].grid.get_field('item_code').get_query = function(doc) {
return{
query: "erpnext.controllers.queries.item_query",
- filters: {
- "name": "!" + cstr(doc.item)
- }
+ filters: [["Item", "name", "!=", doc.item]]
}
}