Select User by Full Name, not "Email"

When I click on a User input field in erpnext, it provides me with a dropdown list of all the users based on their “Email” instead of their “Username” or their “Full Name” field. Making it difficult to find the right User to select.

Worse still, after selection the input value becomes their “Email” instead of their “Username” or their “Full Name” field. Making it very difficult to tell who those Users really are on the list.

Is there anyway of using their “Username” or their “Full Name” instead of their “Email” ?

We want to know who that User really is by name, not by their “Email”

Thanks very much for any help.

You should be able to see the full name on selection. See below:

Thanks Rushabh for your quick response.

The Full Name is there in the input list and I think it is even sorted! But the Email is so big and bold, that it takes the mind a lot of work to ignore it in order to read the Full Name properly.

On the output list the Full Name is no longer there.

I can understand that programmers like to list things based on unique fields like Email, but for end users the Name of the person is what identifies that person the easiest.

I am new to Erpnext and this is my first day evaluating Erpnext, even though I might decide not to deploy Erpnext at the end, I am still willing to fund (within reason) 2 small changes in how User Lists are displayed.

  1. For User Input, the swapping of the email and name in the User List will help a lot. The Username or Full Name will now be large and bold and will be the first one. The Email will remain as a reference.

  2. For User Output, using Username or Full Name as output (instead of Email) is even more important, as unlike on the Input List, that is the only thing being shown on User output list.

Internally nothing change for both Input and Output list, it is just external display that is changed.

I don’t know whether Erpnext allows duplicated Username or Full Name, but even if it does, the End User will see the duplicates very easily and change them to avoid conflicts.

The above might just be important to me only, in that case, I am happy to fund the changes without merging back and just use it in my ERP evaluation over the next 2 months. During my short time browsing, I started to like Erpnext’s philosophy and community already and hate to see it disadvantaged because of some simple UI inefficiencies.

I don’t believe the above 2 changes will costs much time or money … thus I am willing to fund them :), but I do appreciate that Frappe is very busy with a lot of different priorities, so if it is better for me to get someone else to do it and contribute back (pull request ?) I am ok as well.

Kind regards, ETC

You can try writing a custom query. This could be used:

In (Custom) JS of the doctype:

user_id: function(frm){
		frm.set_query('user_id', function(frm){
			return{
				query: 'get_user'
			}
		})
	},

In Python

@frappe.whitelist()
def get_user(doctype, txt, searchfield, start, page_len, filters):
	return frappe.db.sql("""
		SELECT 
			name, full_name
		FROM
			`tabUser`
		WHERE
			username like %(txt)s or
			fullname like %(txt)s
		LIMIT 5
	""",{
		'txt': "%%%s%%" %txt,
		'_txt': txt.replace("%",""),
		'start': start,
		'page_len': page_len
	})

This python code gives you the flexibility to search either username or the fullname of the user.

You can add a field called User Name and fetch full_name value from the Link field user_id by mentioning user_id.full_name in the Fetch From section of that field. So each time a user is selected the Full Name will be fetched automatically.

1 Like

Thanks Jatin for your solution.

Unfortunately, I am on a very tight evaluation schedule, so do not have much time to learn and play with Erpnext at code level myself. For example, I got no idea which files to apply your suggestions to :frowning:

Luckily I just discover this wonderful thing called Paid Development:
https://erpnext.com/pricing/paid-feature-development

So have now submitted a request on GitHub:

If that does not work out, I shall pass your suggestions onto some programmers and see whether they can work out where to apply those changes.

Thanks again for your help.
Erpnext support is great!

1 Like

Oh I should have specified it. I guess since you have no time you’ll also not be able to spend more time on Custom apps too.

The JS part goes into either the Custom Script (feature available from UI) or a JS file in your custom app. Same for the Python function. It can reside in the custom app itself. Later on the Path mentioned in the JS file should be updated to the current path of the python function.

Thanks Jatin for following up your suggestion with more hints.

I have not got a reply from Frappé for my Paid Development request yet, may be they are very busy and this issue is now looking more like a customisation rather than an enhancement. Looks like I need to arrange some local help to perform these customisations on Erpnext myself.

In the meantime, will you have the time or interest to implement what you suggested above for just one page, the Project Form ?

e.g.
https://erpnext.example.com/desk#Form/Project/Test%20Project

I think it will be good to have someone experienced with Erpnext customisation to kick start our local customisation effort.

Is the US$70/hour rate quoted by Paid Development link acceptable for these type of customisation ?

I assume a custom app has to be built with the javascript and python code you specified above ?

I am not sure how much time this job of changing the User listing inside the Project Form from Email to Name will take and what you need besides an SSH account into the system, but all that can be discussed.

As mentioned above, I am new to this and not sure what is the proper process for getting help (besides asking for Paid Development, which I have already done). If this is not the proper way of requesting help on Erpnext, I am happy to follow whatever is “right” way.

You can post your requirement on https://erpnext.org/erpnext-jobs

I have suggested custom app because it lets your frappe and erpnext repos untouched and still gets you the customization. TO me it seems a bit overkill if you will not have any more customizations especially in the code, but in the long run when there can be custom fields, reports, etc a custom app is just alright. But an experienced developer will know better than me. All the best !