From 8b133ac08763f183df1890d54b63bb676f7d926d Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 6 Jan 2017 17:20:44 +0530 Subject: [PATCH] [minor] [tests] fix, tests will fail on the 5th of a month! --- erpnext/hr/doctype/salary_slip/test_salary_slip.py | 2 +- erpnext/stock/doctype/warehouse/warehouse.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/erpnext/hr/doctype/salary_slip/test_salary_slip.py b/erpnext/hr/doctype/salary_slip/test_salary_slip.py index 54faa64053..3eec6869e4 100644 --- a/erpnext/hr/doctype/salary_slip/test_salary_slip.py +++ b/erpnext/hr/doctype/salary_slip/test_salary_slip.py @@ -76,7 +76,7 @@ class TestSalarySlip(unittest.TestCase): if getdate(nowdate()).day >= 15: date_of_joining = getdate(add_days(nowdate(),-10)) relieving_date = getdate(add_days(nowdate(),-10)) - elif getdate(nowdate()).day < 15 and getdate(nowdate()).day > 5: + elif getdate(nowdate()).day < 15 and getdate(nowdate()).day >= 5: date_of_joining = getdate(add_days(nowdate(),-3)) relieving_date = getdate(add_days(nowdate(),-3)) elif getdate(nowdate()).day < 5 and not getdate(nowdate()).day == 1: diff --git a/erpnext/stock/doctype/warehouse/warehouse.py b/erpnext/stock/doctype/warehouse/warehouse.py index e01cc0b6fe..1d2befaf24 100644 --- a/erpnext/stock/doctype/warehouse/warehouse.py +++ b/erpnext/stock/doctype/warehouse/warehouse.py @@ -74,7 +74,7 @@ class Warehouse(NestedSet): ac_doc.flags.ignore_mandatory = True try: ac_doc.insert() - msgprint(_("Account head {0} created").format(ac_doc.name)) + msgprint(_("Account head {0} created").format(ac_doc.name), indicator='green', alert=True) except frappe.DuplicateEntryError, e: if not (e.args and e.args[0]=='Account'): @@ -193,9 +193,9 @@ class Warehouse(NestedSet): existing_allow_negative_stock = frappe.db.get_value("Stock Settings", None, "allow_negative_stock") frappe.db.set_value("Stock Settings", None, "allow_negative_stock", 1) - repost_stock_for_items = frappe.db.sql_list("""select distinct item_code + repost_stock_for_items = frappe.db.sql_list("""select distinct item_code from tabBin where warehouse=%s""", newdn) - + # Delete all existing bins to avoid duplicate bins for the same item and warehouse frappe.db.sql("delete from `tabBin` where warehouse=%s", newdn)