I’m new to frappe, trying to find my way to update some doctypes. My case is not trivial, as the customization is not about adding new fields to the doctype, but rather update the doctype itself. Let me elaborate:
The docType “User” has an attribute called “name” with the value “User”
I’m looking to add a new fied to the “User” doctype, called “plural_name”, and it has the value “Users”
The change would affect core and normal doctypes, and it better be in a custom app.
Can someone guide me on the best way to implement that?
Regards
You cant customize the User doctype, it is a Frappe Framework core doctype that shouldn’t be changed.
The ‘name’ field is reserved for every doctype let it be core or custom and it is the schema id of the record (similar to creation, last_updated, owner)
Attempting to adjust how records are stored and named in the database is reinventing the wheel
I do not understand what’s the goal or use case of your mentioned customization, what are you trying to achieve? can you elaborate more
Thanks,
My goal is to have a proper Arabic translations. In English the term “User List” is valid, but it’s Arabic translation “قائمة مستخدم” doesn’t make any sense. It has to be “قائمة المستخدمين”, which translates to “The Users List”.
In other places like “New User” the singular is valid in English and Arabic. “مستخدم جديد” is good
So, i’m trying to have singluar and plural forms of the name.
Do you have a better suggestion to handle this case?
If you used the plural form then it would be المستخدمين جديد and not مستخدم جديد
Your best bet is getting used to it, otherwise if you are developing for a picky client then try this
https://docs.frappe.io/framework/user/en/guides/basics/translations
Translate everything to plural form then for the ‘add’ button you would have to target each doctype list view through JS to rename them to singular.
If you are using ERPNext then it is a hell process to translate everything but if you are developing your custom Frappe app then there wouldn’t be much translations to do (only the main core doctypes)
I know, this is exactly why i want to add the plural form, to use plural form in some places (like doctype list) and the singular form in others (like the new doctype)
Let me make it easier: If we ignored the core doctypes, and focused on normal ones only (say Customer Doctype), what would be the best way to add the plural_name field?
Do not modify doctypes especially when you are novice! Do you even know how to safely handle developments that are transferrable and persistable throughout the updates? Have you evaluated what is the proper way to update such a user interface issue? Don’t go into development territory with such ignorance. Have you tried to write translation in the awesome bar?