Merge pull request #6878 from saurabh6790/reporting_stock_after_rename_warehouse
[fix] repost qty only for bin items
This commit is contained in:
commit
4430f2f81c
@ -195,11 +195,8 @@ 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)
|
||||
|
||||
for item in frappe.db.sql("""select distinct item_code from (
|
||||
select name as item_code from `tabItem` where is_stock_item=1
|
||||
union
|
||||
select distinct item_code from tabBin) a"""):
|
||||
repost_stock(item[0], newdn)
|
||||
for item in frappe.db.sql(""" select distinct item_code from tabBin where warehouse = %s""", newdn):
|
||||
repost_stock(item[0], newdn)
|
||||
|
||||
frappe.db.set_value("Stock Settings", None, "allow_negative_stock", existing_allow_negative_stock)
|
||||
frappe.db.auto_commit_on_many_writes = 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user