Frappe Core DocTypes can't be customized in Version 11

I wish to create a custom Signup page that would take in details which are not available in the default User DocType. Since version 11, we are not allowed to customize the Frappe Core DocTypes. The details of this DocTypes are also copied to Contact DocType, which can be customized. I can similarly copy details to Customer, or any other DocType. However, adding additional fields in Contact DocType won’t help if the fields are not available in the User DocType. How best to solve this problem?

Mentioned in earlier thread

Add custom fields to the User DocType. Should work.

Yes, that I can do, but won’t it be a problem when Frappe updates to the next version?

Custom fields will never affect in any updates.

1 Like

When I try to customize the User DocType in v11.1.13, I get the error:
image

Is it now really no longer possible (and why)?

I hope that’s just a bug. everything else would be a significant step backwards!

That only refers to the Frappe Core DocTypes.

@lasalesi

Hi. Core DocTypes can be edited if you put ERPNext into developer mode. It is strongly discouraged as when you update ERPNext, changes to the core DocType’s will cause major issues.

As @rmehta replied, best practice is to add custom fields. That way on updates, changes to core DocTypes will not cause you issues.

Thanks.

1 Like

Hi @abbas,

thank you for your reply. I actually do not want to edit the core DocType, I only want to customize them, i.e. add custom fields. Clicking e.g. User > Customize however leads to the above screenshot and does not allow to edit. Also Custom Field List > New on DocType User does not work (same error dialog). Therefore I conclude that customisation of core DocTypes has been surpressed. This has been used (and I am happy that this is kept on updates and fixtures), but I fail to understand why this has been prevented…

Hi.

I have just checked my system Hub User and Hub Users docTypes allow custom fields. User docType which has all the users data unfortunately cannot have custom fields.

In this case, the alternative is to have a new DocType “Users2” if you really need additional fields…

Sorry.

Hello @lasalesi

Have you tried to put ERPNext into developer mode and then tried the customization?

Reagards
Bilal

Hi @bghayad,
thanks, yes, I am in developer mode.

Actually, I was able to resolve the issue using fixtures of a custom app. Only trying to figure out the reason, why this is locked (and to be honest, I would much like to have this back)!

1 Like

Hello @lasalesi, thank you too.

So it is confirmed that it is locked?
Like what doctype that this is locked? Is it also locked for customer doctype as example?
Can you please let me know how you used the fixtures of the custom app to resolve it?

Regards
Bilal

Hi @lasalesi,

yes, the Frappe Core DocTypes are locked by this “feature”, most prominently User.

You can manually edit the fixtures file and add the required additional fields there, this will create the custom field record (which in the front-end will still be locked). For example like this:

{
  "allow_on_submit": 0,
  "bold": 0,
  "collapsible": 0,
  "collapsible_depends_on": null,
  "columns": 0,
  "default": null,
  "depends_on": null,
  "description": null,
  "docstatus": 0,
  "doctype": "Custom Field",
  "dt": "User",
  "fetch_from": null,
  "fieldname": "signature",
  "fieldtype": "Attach Image",
  "hidden": 0,
  "ignore_user_permissions": 0,
  "ignore_xss_filter": 0,
  "in_global_search": 0,
  "in_list_view": 0,
  "in_standard_filter": 0,
  "insert_after": "section_signature_cost_center",
  "label": "Signature",
  "modified": "2019-03-06 21:52:14.685977",
  "name": "User-signature",
  "no_copy": 0,
  "options": "",
  "permlevel": 0,
  "precision": "",
  "print_hide": 0,
  "print_hide_if_no_value": 0,
  "print_width": null,
  "read_only": 0,
  "report_hide": 0,
  "reqd": 0,
  "search_index": 0,
  "translatable": 0,
  "unique": 0,
  "width": null
},  

Hope this helps as a workaround.

1 Like

What other doctype that might also be locked other than User doctype? How can I know that this doctype is Frappe Core DocTypes?

What you will do if you upgrade ERPNext? This will be removed.

Regards
Bilal

You can check which doctypes are “Frappe Core”: frappe/frappe/core/doctype at develop · frappe/frappe · GitHub

Fixtures and also earlier customisations are maintained during upgrades (tested in v11).

Great.
I know that you can do customization for the documents using customize form and it will not be affected by upgrade. But how do you protect your fixtures?

One more thing: if you need to do a new installation for ERPNext and you need your customized forms and your fixtures to be installed at the new installation (fresh installation), what is the method that you use it for this?

Regards
Bilal

Thank you @lasalesi
Regards
Bilal

Hi @bghayad,

I have tested the fixtures in v11 (on a new installation) and it works fine. It is only the “Customize Form” which is affected… You can check that the custom field record is created properly.

1 Like

@lasalesi @rmehta I am a little lost with the convo above. I have tested “Customize Form” on Frappe Core doctypes and never had a problem (v11) until now with “User” which I have existing customizations for.

Why is the statement that “We don’t allow you to customize Frappe core doctypes,” but in fact you can customize most of them, just not “User”.

Is this in fact a bug that needs fixed?

Too many people shoot themselves in the foot by being too creative and customising core features. Ideally there must be a customisable check on each doctype and field at design level.