Disallow Rename field

Hello Everyone,

In any doctype if I want to disallow rename fuction than how it can be done?

Thanks in advance

Hi @Foram In which document you are trying this ?

Create a property setter (like this one for Item DocType):

{
   "name":"Item-main-allow_rename",
   "owner":"Administrator",
   "creation":"2022-11-22 19:33:26.977825",
   "modified":"2022-11-22 19:33:26.977825",
   "modified_by":"Administrator",
   "docstatus":0,
   "idx":0,
   "is_system_generated":0,
   "doctype_or_field":"DocType",
   "doc_type":"Item",
   "property":"allow_rename",
   "property_type":"Check",
   "value":"0",
   "doctype":"Property Setter"
}

Hello @Foram [For custom Doctype only]
First you would have to enable developer mode
you can do that by simply adding this line of code in you ./bench/sites/your_site/site.config.json file

 "developer_mode": 1,

Next open the list page of any doctype and above there when you click on three dost you can see “Edit doctype” option
Once you clikc on that go below and you can see this check box Rename doctype


Just uncheck that
later you can remove the line you added in your site_confif.json file

@Harsh_Magiya @Foram

You should avoid doing this for core doctypes of frappe / erpnext as it will broke upcoming version upgrade, there are alternate solutions available.

Manual creation of property setter is one of them.

1 Like

I want to disallow the renaming of item doctype without developer mode on.

Can you brief it what you are saying for disallowing the renaming of item doctype?

@Foram

Add this values in property setter. it will work for you