From ad7eb9d03cdecaa26ae9f62963c298c4b1246e51 Mon Sep 17 00:00:00 2001 From: Makarand Bauskar Date: Fri, 14 Jul 2017 17:31:36 +0530 Subject: [PATCH 1/3] [minor] check mode_of_payment in Payment entry (#9869) * [minor] don't trigger the expense type trigger if value is not set * [minor] check if account is selected or not in Payment Entry * [minor] check mode_of_payment in Payment entry --- erpnext/accounts/doctype/payment_entry/payment_entry.js | 2 +- erpnext/hr/doctype/expense_claim/expense_claim.js | 4 ++++ erpnext/public/js/controllers/accounts.js | 4 ++++ 3 files changed, 9 insertions(+), 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: { 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: { 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: { From 087da2e5719234af9c5b9944876d73e24929e6cf Mon Sep 17 00:00:00 2001 From: Makarand Bauskar Date: Fri, 14 Jul 2017 17:44:26 +0530 Subject: [PATCH 2/3] Fixed patch (#9862) (#9871) --- .../fix_nonwarehouse_ledger_gl_entries_for_transactions.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/patches/v7_0/fix_nonwarehouse_ledger_gl_entries_for_transactions.py b/erpnext/patches/v7_0/fix_nonwarehouse_ledger_gl_entries_for_transactions.py index d0e816a1a2..2b92b17f11 100644 --- a/erpnext/patches/v7_0/fix_nonwarehouse_ledger_gl_entries_for_transactions.py +++ b/erpnext/patches/v7_0/fix_nonwarehouse_ledger_gl_entries_for_transactions.py @@ -7,10 +7,11 @@ import frappe, erpnext def execute(): frappe.reload_doctype("Account") - warehouses = frappe.db.sql_list("""select name, company from tabAccount + warehouses = frappe.db.sql("""select name, company from tabAccount where account_type = 'Stock' and is_group = 0 - and (warehouse is null or warehouse = '')""", as_dict) + and (warehouse is null or warehouse = '')""", as_dict=1) warehouses = [d.name for d in warehouses if erpnext.is_perpetual_inventory_enabled(d.company)] + if len(warehouses) > 0: warehouses = set_warehouse_for_stock_account(warehouses) if not warehouses: From 30e987a83551e8879da346738a3c97e354a701a1 Mon Sep 17 00:00:00 2001 From: mbauskar Date: Fri, 14 Jul 2017 18:17:07 +0600 Subject: [PATCH 3/3] bumped to version 8.4.3 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index ef9b89c43b..fd32dd45e3 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals import frappe -__version__ = '8.4.2' +__version__ = '8.4.3' def get_default_company(user=None): '''Get default company for user'''