Add New Doctype in Existing Module

I have installed ERPNext Production, then i want to add new DocType to HR-Employee Module.
Doctype create but i can call it from Employee Module.
Please kindly let me know the guide for this.

Regards,

1 Like

If you have a new Doctype and you want to add a link to it that you can click on in the HR module, then you need to add your new Doctype to the hr.py file in ~/frappe-bench/erpnext/erpnext/config

2 Likes

Dbone, i want to add like Employee Education.
my doctype name Employee Children, i want to add this in the Employee Form.

From config i can’t find Employee Education.

Regards,

I’m having trouble understanding what you want. Do you want to add a custom Doctype as a child table in a form?

I want to add form table in the employee form.
i’m try to follow like Employee Education … when check the employee education, it’s need doctype.
after make doctype … i’m still not able to call the new doctype …

i just check the folder of hr they have folder for
doctype /home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype

To add a doctype as a child table:

  • Go to Setup–>Customize Form
  • Open the doctype you want to add the child table in
  • make a new field with the field type “Table”
  • put the name of the doctype you want to add as a child table in the “Options” section

Already but the table it’s empty.

Do you have any fields in your new doctype?

Yes …

and i’m follow the step for Employee Education.

btw in production can we add customize doctype?
Regards,

Please send a screenshot of what you see in your parent doctype.

Yes, you can add custom doctypes in production mode but they will not save into py files on the server until you switch to development mode.

Here the capture.

The Customize Form

The Output for employee

The doctype

What happens when you add a new row on the form (not in the doctype)?

Right now I’m guessing that you’ll see a row appear that has only a drop down arrow on it. When you click the drop down arrow you’ll see all your fields.

If this is the case, you need to set all the fields you want to see in the grid view to be “in list view” in your doctype.

Yes you right…

btw how to save the new doctype into py files.

When I create all my custom doctypes they are set to be part of my custom app. This way they are safe from being overwritten by updates to the software.

To switch to developer mode add a new line in:

~/frappe-bench/sites/[your sitename here]/site_config.json

add: "developer_mode": 1,

Files are created automatically

what is that mean?

and after set to 1 no need any restart services?

I think you also need to go into the Doctype and uncheck “custom”. Not sure if you need a restart.

If you want to use ERPNext for your live records and still be able to customize and test settings, the best practise is this:
Have 2 servers, 1 in production mode that you use daily, and 1 in developer mode. You create a custom app with the Frappe framework and push all your customisations to the custom app. Then when you’re satisfied it all works properly you install (or update) the your custom app on the production server. You could use a separate VM for development.

Having a custom app gives you a place to save your work that is separate from ERPNext. That way you can update ERPNext and never worry about anything being overwritten. There is a developer tutorial here that is helpful for getting started: http://frappe.github.io/frappe/user/

I won’t go into anymore detail about custom apps here since there is loads of information on this forum about it.

If your initial question is answered please mark the solution. That way we don’t get too far off topic and the thread is still useful for people searching the forum for answers. :slight_smile: