Create sample Material Requests via setup wizard only if warehouse exists
This commit is contained in:
parent
4f01704234
commit
24f1c50dca
@ -15,6 +15,7 @@ def make_sample_data():
|
||||
selling_items = frappe.get_all("Item", filters = {"is_sales_item": 1})
|
||||
buying_items = frappe.get_all("Item", filters = {"is_purchase_item": 1})
|
||||
customers = frappe.get_all("Customer")
|
||||
warehouses = frappe.get_all("Warehouse")
|
||||
|
||||
if selling_items and customers:
|
||||
for i in range(3):
|
||||
@ -24,7 +25,7 @@ def make_sample_data():
|
||||
|
||||
make_projects()
|
||||
|
||||
if buying_items:
|
||||
if buying_items and warehouses:
|
||||
make_material_request(buying_items)
|
||||
|
||||
frappe.db.commit()
|
||||
|
Loading…
Reference in New Issue
Block a user