def walk_and_sync(start_path, force=0, sync_everything = False): """walk and sync all doctypes and pages""" modules = [] document_type = ['doctype', 'page', 'report'] for path, folders, files in os.walk(start_path): # sort folders so that doctypes are synced before pages or reports folders.sort() if sync_everything or (os.path.basename(os.path.dirname(path)) in document_type): for f in files: if f.endswith(".txt"): doc_name = f.split(".txt")[0] if doc_name == os.path.basename(path): module_name = path.split(os.sep)[-3] doctype = path.split(os.sep)[-2] name = path.split(os.sep)[-1] if import_file(module_name, doctype, name, force): print module_name + ' | ' + doctype + ' | ' + name webnotes.conn.commit() return modules
def walk_and_sync(start_path, force=0, sync_everything=False): """walk and sync all doctypes and pages""" modules = [] document_type = ['doctype', 'page', 'report'] for path, folders, files in os.walk(start_path): # sort folders so that doctypes are synced before pages or reports folders.sort() if sync_everything or (os.path.basename(os.path.dirname(path)) in document_type): for f in files: f = cstr(f) if f.endswith(".txt"): doc_name = f.split(".txt")[0] if doc_name == os.path.basename(path): module_name = path.split(os.sep)[-3] doctype = path.split(os.sep)[-2] name = path.split(os.sep)[-1] if import_file(module_name, doctype, name, force): print module_name + ' | ' + doctype + ' | ' + name webnotes.conn.commit() return modules
def execute(): from webnotes.modules.import_file import import_file import_file("accounts", "GL Mapper", "Journal Voucher") import_file("accounts", "GL Mapper", "Purchase Invoice") import_file("accounts", "GL Mapper", "Purchase Invoice with write off")
def execute(): return from webnotes.modules.import_file import import_file import_file("accounts", "GL Mapper", "Journal Voucher") import_file("accounts", "GL Mapper", "Purchase Invoice") import_file("accounts", "GL Mapper", "Purchase Invoice with write off")