def set_desktop_icons(visible_list, ignore_duplicate=True):
 frappe.db.sql(u'delete from `tabDesktop Icon` where standard=0')
 frappe.db.sql(u'update `tabDesktop Icon` set blocked=0, hidden=1')
 for module_name in visible_list:
  name = frappe.db.get_value(u'Desktop Icon', {u'module_name': module_name})
  if name:
   frappe.db.set_value(u'Desktop Icon', name, u'hidden', 0)
  elif frappe.db.exists(u'DocType', module_name):
   try:
    add_user_icon(module_name, standard=1)
   except frappe.UniqueValidationError as e:
    if (not ignore_duplicate):
     raise e
    else:
     visible_list.remove(module_name)
     if frappe.message_log:
      frappe.message_log.pop()
 set_order(visible_list)
 clear_desktop_icons_cache()

def set_desktop_icons ( visible_list , ignore_duplicate = True ) : frappe . db . sql ( u'delete from `tabDesktop Icon` where standard=0' ) frappe . db . sql ( u'update `tabDesktop Icon` set blocked=0, hidden=1' ) for module_name in visible_list : name = frappe . db . get_value ( u'Desktop Icon' , { u'module_name' : module_name } ) if name : frappe . db . set_value ( u'Desktop Icon' , name , u'hidden' , 0 ) elif frappe . db . exists ( u'DocType' , module_name ) : try : add_user_icon ( module_name , standard = 1 ) except frappe . UniqueValidationError as e : if ( not ignore_duplicate ) : raise e else : visible_list . remove ( module_name ) if frappe . message_log : frappe . message_log . pop ( ) set_order ( visible_list ) clear_desktop_icons_cache ( )
resets all lists and makes only the given one standard .