fix: make location from warehouse patch

- optimization by preventing patch execution if Asset doesn't exist
This commit is contained in:
Ameya Shenoy 2018-10-07 13:08:00 +05:30
parent 29fe8ce114
commit f7b5b7beb4

View File

@ -6,6 +6,7 @@ import frappe
from frappe.utils.nestedset import rebuild_tree from frappe.utils.nestedset import rebuild_tree
def execute(): def execute():
if not frappe.db.get_value('Asset', {'docstatus': ('<', 2) }, 'name'): return
frappe.reload_doc('assets', 'doctype', 'location') frappe.reload_doc('assets', 'doctype', 'location')
frappe.reload_doc('stock', 'doctype', 'warehouse') frappe.reload_doc('stock', 'doctype', 'warehouse')