From ed89a83584a20c92100b14060122a8dc24848202 Mon Sep 17 00:00:00 2001 From: mbauskar Date: Fri, 14 Jul 2017 11:20:32 +0530 Subject: [PATCH 1/3] [minor] don't trigger the expense type trigger if value is not set --- erpnext/hr/doctype/expense_claim/expense_claim.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/erpnext/hr/doctype/expense_claim/expense_claim.js b/erpnext/hr/doctype/expense_claim/expense_claim.js index 4ce91c4bf9..2a94d05495 100644 --- a/erpnext/hr/doctype/expense_claim/expense_claim.js +++ b/erpnext/hr/doctype/expense_claim/expense_claim.js @@ -27,6 +27,10 @@ erpnext.hr.ExpenseClaimController = frappe.ui.form.Controller.extend({ return; } + if(!d.expense_type) { + return; + } + return frappe.call({ method: "erpnext.hr.doctype.expense_claim.expense_claim.get_expense_claim_account", args: { From 00e825a8afc83768ffe9cd3ad6c0410905dbf768 Mon Sep 17 00:00:00 2001 From: mbauskar Date: Fri, 14 Jul 2017 11:38:39 +0530 Subject: [PATCH 2/3] [minor] check if account is selected or not in Payment Entry --- erpnext/accounts/doctype/payment_entry/payment_entry.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.js b/erpnext/accounts/doctype/payment_entry/payment_entry.js index 63832fa2c9..eb0f474e08 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.js +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.js @@ -291,7 +291,7 @@ frappe.ui.form.on('Payment Entry', { set_account_currency_and_balance: function(frm, account, currency_field, balance_field, callback_function) { - if (frm.doc.posting_date) { + if (frm.doc.posting_date && account) { frappe.call({ method: "erpnext.accounts.doctype.payment_entry.payment_entry.get_account_details", args: { From 1394a6557d4d0e4b46cb90b2217c3621dc591e87 Mon Sep 17 00:00:00 2001 From: mbauskar Date: Fri, 14 Jul 2017 12:09:17 +0530 Subject: [PATCH 3/3] [minor] check mode_of_payment in Payment entry --- erpnext/public/js/controllers/accounts.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/erpnext/public/js/controllers/accounts.js b/erpnext/public/js/controllers/accounts.js index 19ef162f3d..abd5566243 100644 --- a/erpnext/public/js/controllers/accounts.js +++ b/erpnext/public/js/controllers/accounts.js @@ -94,6 +94,10 @@ var get_payment_mode_account = function(frm, mode_of_payment, callback) { frappe.throw(__("Please select the Company first")); } + if(!mode_of_payment) { + return; + } + return frappe.call({ method: "erpnext.accounts.doctype.sales_invoice.sales_invoice.get_bank_cash_account", args: {