def sync_customizations(app=None):
 if app:
  apps = [app]
 else:
  apps = frappe.get_installed_apps()
 for app_name in apps:
  for module_name in (frappe.local.app_modules.get(app_name) or []):
   folder = frappe.get_app_path(app_name, module_name, u'custom')
   if os.path.exists(folder):
    for fname in os.listdir(folder):
     with open(os.path.join(folder, fname), u'r') as f:
      data = json.loads(f.read())
     if data.get(u'sync_on_migrate'):
      sync_customizations_for_doctype(data)

def sync_customizations ( app = None ) : if app : apps = [ app ] else : apps = frappe . get_installed_apps ( ) for app_name in apps : for module_name in ( frappe . local . app_modules . get ( app_name ) or [ ] ) : folder = frappe . get_app_path ( app_name , module_name , u'custom' ) if os . path . exists ( folder ) : for fname in os . listdir ( folder ) : with open ( os . path . join ( folder , fname ) , u'r' ) as f : data = json . loads ( f . read ( ) ) if data . get ( u'sync_on_migrate' ) : sync_customizations_for_doctype ( data )
sync custom fields and property setters from custom folder in each app module .