fixes during testing version 5

This commit is contained in:
Nabin Hait
2014-11-26 15:35:08 +05:30
parent 9ed41b3abb
commit 249bbbc56f
21 changed files with 113 additions and 65 deletions

View File

@@ -16,7 +16,8 @@ def repost(only_actual=False, allow_negative_stock=False, allow_zero_rate=False)
frappe.db.auto_commit_on_many_writes = 1
if allow_negative_stock:
frappe.db.set_default("allow_negative_stock", 1)
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)
for d in frappe.db.sql("""select distinct item_code, warehouse from
(select item_code, warehouse from tabBin
@@ -29,8 +30,7 @@ def repost(only_actual=False, allow_negative_stock=False, allow_zero_rate=False)
frappe.db.rollback()
if allow_negative_stock:
frappe.db.set_default("allow_negative_stock",
frappe.db.get_value("Stock Settings", None, "allow_negative_stock"))
frappe.db.set_value("Stock Settings", None, "allow_negative_stock", existing_allow_negative_stock)
frappe.db.auto_commit_on_many_writes = 0
def repost_stock(item_code, warehouse, allow_zero_rate=False, only_actual=False):