Hello Everyone,
My Usecase:
- Define an app for my module that allows users to be assigned items
- Define a custom user Doctype and a custom Item Doctype
I added a custom Doctype (let call it Library User) with an Assigned To field, (I want this Library User Doctype to be able to see all assignment to them and act on it as well), I believe that this is a great case for a regular link field to the User Doctype, but I am not sure if any customization that I make to the User Doctype will be available in the code for distribution later.
What is the recommended way of building this type of functionality?, or should I just use the default User Doctype for my module?
Hi,
Welcome to our Community.
The mentioned requirement is not very clear to me. but we can create custom field in User right. Please try that way.
Thanks & Regards
Hi @Gubbu77,
Thanks for the reply, so to explain further, I want to build a custom Doctype called Engagement, this is similar in idea to a Task, and it would be assigned to another custom Doctype called Audit User. Because of the assignment I want for a user to be able to login to view the assignments (Enagements Doctypes) made to them, and work on it.
Now my question is, for this usecase, should I just use the default User Doctype in place of Audit User? (meaning dont create the custom Audit User Doctype at all) and create a link field to the default User Doctype from the Engagement Doctype? What is the best way of handling this type of flow? The reason that I ask is because I want to be able to easily distribute the custom code as an app to another Frappe instance later.
I dont know if it is clearer now?
If Audit User doesn’t need custom fields, utilize the Frappe User docType. If it requires custom fields not already included with Frappe User, I suggest creating the Audit User docType. You can customize Frappe User in your app using features like Fixtures, custom _fields, etc.
Hi @moschap ,
I understand the requirement now,
There are tow ways:
-
For better understanding you can create both Doctypes (Engagement and Audit User). In Audit User you can Link the User Doctype and specify the User. After the user is Linked to the Audit User you can create a User Permission for that Audit User (for viewing only that Audit User Assignments).
-
Another way is directly linking User to Engagements (but in the Link Field the user id will be visible eg: xyz@tech.com instead of real name so if it is Audit User we can change the name), for the assigned Engagements you can create user permission for the User only.
Eg: User Permission
User: xyz@tech.com
Allow: User
For Value: xyz@tech.com
Thanks
Hi @Gubbu77 & @volkswagner,
So I went with the 2nd option, because i think that most of the functionalities that I need for the Audit User already exists in the default User Doctype, would have to deal with any customization in the User Doctype later.
Also I dont want to add the extra overhead of creating 2 sets of records per user (User and Audit User).
1 Like