def get_file_path(module, dt, dn): dt, dn = scrub_dt_dn(dt, dn) path = os.path.join(get_module_path(module), os.path.join(dt, dn, dn + ".json")) return path
def create_folder(module, dt, dn, create_init): module_path = get_module_path(module) dt, dn = scrub_dt_dn(dt, dn) # create folder folder = os.path.join(module_path, dt, dn) frappe.create_folder(folder) # create init_py_files if create_init: create_init_py(module_path, dt, dn) return folder
def on_update(self): # update custom fields in mappings self.make_custom_fields_for_mappings() if frappe.flags.in_import or frappe.flags.in_test: return if frappe.local.conf.get('developer_mode'): record_list =[['Data Migration Plan', self.name]] for m in self.mappings: record_list.append(['Data Migration Mapping', m.mapping]) export_to_files(record_list=record_list, record_module=self.module) for m in self.mappings: dt, dn = scrub_dt_dn('Data Migration Mapping', m.mapping) create_init_py(get_module_path(self.module), dt, dn)
def on_update(self): # update custom fields in mappings self.make_custom_fields_for_mappings() if frappe.flags.in_import or frappe.flags.in_test: return if frappe.local.conf.get('developer_mode'): record_list = [['Data Migration Plan', self.name]] for m in self.mappings: record_list.append(['Data Migration Mapping', m.mapping]) export_to_files(record_list=record_list, record_module=self.module) for m in self.mappings: dt, dn = scrub_dt_dn('Data Migration Mapping', m.mapping) create_init_py(get_module_path(self.module), dt, dn)
def create_folder(module, dt, dn, create_init): if frappe.db.get_value('Module Def', module, 'custom'): module_path = get_custom_module_path(module) else: module_path = get_module_path(module) dt, dn = scrub_dt_dn(dt, dn) # create folder folder = os.path.join(module_path, dt, dn) frappe.create_folder(folder) # create init_py_files if create_init: create_init_py(module_path, dt, dn) return folder