diff --git a/erpnext/accounts/doctype/tax_rule/tax_rule.py b/erpnext/accounts/doctype/tax_rule/tax_rule.py index 9c091e8c9d6..2e92e054586 100644 --- a/erpnext/accounts/doctype/tax_rule/tax_rule.py +++ b/erpnext/accounts/doctype/tax_rule/tax_rule.py @@ -130,8 +130,8 @@ def get_party_details(party, party_type, args=None): def get_tax_template(posting_date, args): """Get matching tax rule""" args = frappe._dict(args) - conditions = ["""(from_date is null or from_date = '' or from_date <= '{0}') - and (to_date is null or to_date = '' or to_date >= '{0}')""".format(posting_date)] + conditions = ["""(from_date is null or from_date <= '{0}') + and (to_date is null or to_date >= '{0}')""".format(posting_date)] for key, value in args.iteritems(): if key=="use_for_shopping_cart": diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py index 53f9ecb986e..139586f1e21 100644 --- a/erpnext/controllers/queries.py +++ b/erpnext/controllers/queries.py @@ -257,7 +257,7 @@ def get_delivery_notes_to_be_billed(doctype, txt, searchfield, start, page_len, def get_batch_no(doctype, txt, searchfield, start, page_len, filters): cond = "" if filters.get("posting_date"): - cond = "and (ifnull(batch.expiry_date, '')='' or batch.expiry_date >= %(posting_date)s)" + cond = "and (batch.expiry_date is null or batch.expiry_date >= %(posting_date)s)" batch_nos = None args = { diff --git a/erpnext/patches/v7_1/set_currency_exchange_date.py b/erpnext/patches/v7_1/set_currency_exchange_date.py index 7d8e4f0415d..630b7d42293 100644 --- a/erpnext/patches/v7_1/set_currency_exchange_date.py +++ b/erpnext/patches/v7_1/set_currency_exchange_date.py @@ -5,5 +5,5 @@ def execute(): frappe.db.sql(""" update `tabCurrency Exchange` set `date` = '2010-01-01' - where date is null or date = '' or date = '0000-00-00' + where date is null or date = '0000-00-00' """) \ No newline at end of file diff --git a/erpnext/patches/v7_2/rename_att_date_attendance.py b/erpnext/patches/v7_2/rename_att_date_attendance.py index f7caf706db5..b2658ba7f12 100644 --- a/erpnext/patches/v7_2/rename_att_date_attendance.py +++ b/erpnext/patches/v7_2/rename_att_date_attendance.py @@ -7,7 +7,7 @@ def execute(): frappe.reload_doc("hr", "doctype", "attendance") frappe.db.sql("""update `tabAttendance` set attendance_date = att_date - where attendance_date is null or attendance_date = '' or attendance_date = '0000-00-00'""") + where attendance_date is null or attendance_date = '0000-00-00'""") update_reports("Attendance", "att_date", "attendance_date") update_users_report_view_settings("Attendance", "att_date", "attendance_date") diff --git a/erpnext/patches/v7_2/update_salary_slips.py b/erpnext/patches/v7_2/update_salary_slips.py index 22bb1d82dc9..c6bca8e7b9b 100644 --- a/erpnext/patches/v7_2/update_salary_slips.py +++ b/erpnext/patches/v7_2/update_salary_slips.py @@ -9,8 +9,7 @@ def execute(): salary_slips = frappe.db.sql("""select month, name, fiscal_year from `tabSalary Slip` where (month is not null and month != '') and - (start_date is null or start_date = '') and - (end_date is null or end_date = '') and docstatus != 2""", as_dict=True) + start_date is null and end_date is null and docstatus != 2""", as_dict=True) for salary_slip in salary_slips: if not cint(salary_slip.month):