mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-31 23:33:43 +00:00
fixes during testing version 5
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user