diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py index 8728ac91ad0..bcdf9fcd5dc 100644 --- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py +++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py @@ -168,7 +168,11 @@ def get_pricing_rules(args): field = frappe.scrub(parenttype) condition = "" if args.get(field): - lft, rgt = frappe.db.get_value(parenttype, args[field], ["lft", "rgt"]) + try: + lft, rgt = frappe.db.get_value(parenttype, args[field], ["lft", "rgt"]) + except TypeError: + frappe.throw(_("Invalid {0}").format(args[field])) + parent_groups = frappe.db.sql_list("""select name from `tab%s` where lft<=%s and rgt>=%s""" % (parenttype, '%s', '%s'), (lft, rgt)) diff --git a/erpnext/hr/doctype/process_payroll/process_payroll.py b/erpnext/hr/doctype/process_payroll/process_payroll.py index 4900bd0ec0d..3658e650f43 100644 --- a/erpnext/hr/doctype/process_payroll/process_payroll.py +++ b/erpnext/hr/doctype/process_payroll/process_payroll.py @@ -196,11 +196,11 @@ class ProcessPayroll(Document): journal_entry.set("accounts", [ { "account": salary_account, - "debit": amount + "debit_in_account_currency": amount }, { "account": default_bank_account, - "credit": amount + "credit_in_account_currency": amount }, ])