def make_user_copy(module_name, user):
 standard_name = frappe.db.get_value(u'Desktop Icon', {u'module_name': module_name, u'standard': 1})
 if (not standard_name):
  frappe.throw(u'{0} not found'.format(module_name), frappe.DoesNotExistError)
 original = frappe.get_doc(u'Desktop Icon', standard_name)
 desktop_icon = frappe.get_doc({u'doctype': u'Desktop Icon', u'standard': 0, u'owner': user, u'module_name': module_name})
 for key in (u'app', u'label', u'route', u'type', u'_doctype', u'idx', u'reverse', u'force_show'):
  if original.get(key):
   desktop_icon.set(key, original.get(key))
 desktop_icon.insert(ignore_permissions=True)
 return desktop_icon

def make_user_copy ( module_name , user ) : standard_name = frappe . db . get_value ( u'Desktop Icon' , { u'module_name' : module_name , u'standard' : 1 } ) if ( not standard_name ) : frappe . throw ( u'{0} not found' . format ( module_name ) , frappe . DoesNotExistError ) original = frappe . get_doc ( u'Desktop Icon' , standard_name ) desktop_icon = frappe . get_doc ( { u'doctype' : u'Desktop Icon' , u'standard' : 0 , u'owner' : user , u'module_name' : module_name } ) for key in ( u'app' , u'label' , u'route' , u'type' , u'_doctype' , u'idx' , u'reverse' , u'force_show' ) : if original . get ( key ) : desktop_icon . set ( key , original . get ( key ) ) desktop_icon . insert ( ignore_permissions = True ) return desktop_icon
insert and return the user copy of a standard desktop icon .