fix: remove autocommit from item rename

This commit is contained in:
Ankush Menat 2021-12-03 15:47:16 +05:30 committed by Ankush Menat
parent 72dbc3d6b8
commit 5caf411be3

View File

@ -724,7 +724,6 @@ class Item(WebsiteGenerator):
def recalculate_bin_qty(self, new_name):
from erpnext.stock.stock_balance import repost_stock
frappe.db.auto_commit_on_many_writes = 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)
@ -738,7 +737,6 @@ class Item(WebsiteGenerator):
repost_stock(new_name, warehouse)
frappe.db.set_value("Stock Settings", None, "allow_negative_stock", existing_allow_negative_stock)
frappe.db.auto_commit_on_many_writes = 0
@frappe.whitelist()
def copy_specification_from_item_group(self):