[fix] in set_valuation_method check for is group condition

This commit is contained in:
Saurabh 2016-06-23 17:46:15 +05:30
parent 3a0f96bd00
commit 001d4d74fa

View File

@ -116,10 +116,11 @@ def create_stock_reconciliation(**args):
def set_valuation_method(item_code, valuation_method):
frappe.db.set_value("Item", item_code, "valuation_method", valuation_method)
for warehouse in frappe.get_all("Warehouse", filters={"company": "_Test Company"}):
update_entries_after({
"item_code": item_code,
"warehouse": warehouse.name
}, allow_negative_stock=1)
for warehouse in frappe.get_all("Warehouse", filters={"company": "_Test Company"}, fields=["name", "is_group"]):
if warehouse.is_group == "No":
update_entries_after({
"item_code": item_code,
"warehouse": warehouse.name
}, allow_negative_stock=1)
test_dependencies = ["Item", "Warehouse"]