ERPNext Conference 2019* ERPNext.com Blog

New doctype in existing module or in custom app?


#1

Hi there,

Been reading the forum but I haven’t found what I’ve been looking for, so far.

I’m currently using fixtures for some customization that I made in the Projects module, and export the fixtures to a custom app, but now I need to make new doctypes.

My questions is, which is better, using Projects module and create new doctypes inside the Projects module or copy all Projects module into a custom app module and create new doctypes inside the custom app module?

Or perhaps there is another, better way that I haven’t thought of?

Thanks in advance for your comments/suggestions.


#2

Hi @gueriza,

the correct answer is probably it depends :wink: I would recommend to add your new doctypes in your custom app. This will make it easier to deploy and give you more possibilities (e.g. only like this you can add server side code to your new doctypes). Also, assuming you have a development system along your production system, this will be easier to try out things before they go live.

In case the new doctypes you need are for general use, then it might make sense to consider adding them to the ERPNext app / Projects module. In this case, make a fork of ERPNext, develop the new features and send in a PR. But I guess it is more something specific.

Hope this helps.


#3

Hi @lasalesi,

Thanks for your reply. The new Doctype is actually pretty specific to my requirement (a report consists of combined fields and custom fields in Project doctype).

Correct me if I’m wrong, so in my case it’s probably best to move all Project module into my custom app, and add new doctypes in there, making them together in a module?


#4

You don’t need to copy core files, your custom app with custom DocTypes will have full access to any core tables and functions.


#5

Thanks @igrekus for your reply