You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently DocType names must be globally unique.
As a result it is very easy for DocType names to conflict with each other when adding third party modules.
Worst yet, the conflicts are happens without warning; newer DocTypes with the same name simply "hide" the other older one.
To avoid this problem, I manually prefix the names of my DocTypes to try to keep it unique.
The problem with my approach is
there's no guaranteed that my prefix won't conflict with a third party
the prefix makes my DocType names long and ugly
Sometimes I forget to add the prefix, because it's not natural to do
A better way would be for Frappe to automatically "namespace" DocTypes to the module they belong to.
e.g. The Account DocType in the Accounts module shall automatically be named Accounts.Account.
To make the code compatible we can default to the current namespace when one is not supplied in the code.
e.g.
By third party I meant anything module not written by myself.
I can control the DocType names for the code that I write but I can't control other people's code.
Take the simple example of the Article DocType from the official tutorial https://frappeframework.com/docs/user/en/tutorial
and the Education module from ERPNext https://docs.erpnext.com/docs/user/manual/en/education/lms-masters
There's no reason why the two different Articles can't/shouldn't co-exist, but currently it's not possible.
My proposal is to "namespace" the two Articles so that we can reference them as library_management.Article and education.Article for example.
Currently DocType names must be globally unique.
As a result it is very easy for DocType names to conflict with each other when adding third party modules.
Worst yet, the conflicts are happens without warning; newer DocTypes with the same name simply "hide" the other older one.
To avoid this problem, I manually prefix the names of my DocTypes to try to keep it unique.
The problem with my approach is
A better way would be for Frappe to automatically "namespace" DocTypes to the module they belong to.
e.g. The
Account
DocType in theAccounts
module shall automatically be namedAccounts.Account
.To make the code compatible we can default to the current namespace when one is not supplied in the code.
e.g.
shall mean
The text was updated successfully, but these errors were encountered: