ERPNext confused when i use same doctype name in different modules

Dear All,

when i create doctype called “DoctypeName1” in “module1” module
and create doctype called “DoctypeName1” in “module2” module
“same server same bench”

in the site, is module2 only installed,
so I expect to run module2/DoctypeName1 python functions

but ERPnext execute module1/DoctypeName1 python functions which totally have different functions

hope to get suggestions to handle multi-sites multi apps without facing any errors.

thank you in advance

In Frappe Framework, DocType names have to be unique. You will have to namespace them with your custom app name as a prefix if you want to use conflicting names.

1 Like

I think Frappe should add a feature to allow different DocTypes from different Apps to have the same name and the “prefixing” should be done automatically.
Take the Library Management tutorial for example.
That tutorial creates a DocType named Article, and I just found out it conflicts with the ERPNext Article in the Education app.
These two Articles should co-exist and Frappe should know that they are from different apps.
e.g. the generate db tables should automatically have the prefixing in them, tab_library_management_article and tab_education_article.

I created this feature request to make doctype namespace to their module.
Please vote for it. DocType names should be namespace to the module they belong to · Issue #13337 · frappe/frappe · GitHub

1 Like