Custom naming not working with User Doctype

I’m trying to change the naming rule on the User doctype.

I want to name User docs with a random value. To achieve that, I changed these fields (see the image below) on the User doctype.

Screenshot_20231002_203834

After that, when I create a user. The name property still picks up the email (which is the default behavior). I want it to pick a random hash value.

For example:

Default behavior:

{
        "name": "ayan@example.com",
        "first_name": "Ayan",
        "username": "ayan",
        "email": "ayan@example.com"
}

The behavior I want:

{
        "name": "b7bd08abcd",
        "first_name": "Ayan",
        "username": "ayan",
        "email": "ayan@example.com"
 }

Btw, I can achieve this with other doctypes, facing this issue only with the User doctype.

For example:

Let me know if I’m doing something wrong, I’m new to Frappe.

Hi,

I don’t think you can customize that as it’s a Core Doctype of frappe framework.

Do you try to doing that with “Modify Doctype” of “Custom Doctype” ?

If you check the user.py file I think you’ll find that it’s not easy to customize it.

Hi,

Can you please tell me when can I find that?