fix: "function"al programming++
This commit is contained in:
parent
db6fc6a5fb
commit
c3be3d35e8
1 changed files with 7 additions and 1 deletions
|
|
@ -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
|
||||
Loading…
Add table
Reference in a new issue