diff --git a/frappe/model/sync.py b/frappe/model/sync.py index 138f9eaad4..7ce9dba245 100644 --- a/frappe/model/sync.py +++ b/frappe/model/sync.py @@ -59,9 +59,10 @@ def sync_for(app_name, force=0, sync_everything = False, verbose=False, reset_pe for module_name in frappe.local.app_modules.get(app_name) or []: folder = os.path.dirname(frappe.get_module(app_name + "." + module_name).__file__) - get_doc_files(files, folder) + files = get_doc_files(files, folder, force, sync_everything, verbose=verbose) l = len(files) + if l: for i, doc_path in enumerate(files): import_file_by_path(doc_path, force=force, ignore_version=True, @@ -78,6 +79,9 @@ def sync_for(app_name, force=0, sync_everything = False, verbose=False, reset_pe def get_doc_files(files, start_path): """walk and sync all doctypes and pages""" + if not files: + files = [] + # load in sequence - warning for devs document_types = ['doctype', 'page', 'report', 'dashboard_chart_source', 'print_format', 'web_page', 'website_theme', 'web_form', 'web_template', @@ -95,3 +99,5 @@ def get_doc_files(files, start_path): if os.path.exists(doc_path): if not doc_path in files: files.append(doc_path) + + return files \ No newline at end of file