Merge pull request #6576 from rohitwaghchaure/item_rename_issue

[Fix] Issue in merging duplicate item
This commit is contained in:
Nabin Hait 2016-10-07 14:11:49 +05:30 committed by GitHub
commit 1915214518

View File

@ -567,7 +567,7 @@ class Item(WebsiteGenerator):
existing_allow_negative_stock = frappe.db.get_value("Stock Settings", None, "allow_negative_stock") 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) frappe.db.set_value("Stock Settings", None, "allow_negative_stock", 1)
for warehouse in frappe.db.sql("select name from `tabWarehouse`"): for warehouse in frappe.db.sql("select name from `tabWarehouse` where is_group = 0"):
repost_stock(new_name, warehouse[0]) repost_stock(new_name, warehouse[0])
frappe.db.set_value("Stock Settings", None, "allow_negative_stock", existing_allow_negative_stock) frappe.db.set_value("Stock Settings", None, "allow_negative_stock", existing_allow_negative_stock)