Skip to Content
Menu
This question has been flagged
2 Replies
2655 Views

you can see the below screenshot .. while am creating a user, it is automatically created a vendor .. after the mail id u can see a related partner field ... I need a solution for that. I need to create a user but not a vendor with the same name. basically am asking, how can I avoid that field? (you can see that feature by enabling the developer mode) 

Avatar
Discard
Best Answer

Hi,

res.users model is created by inheriting(delegation inheritance) of the res.partner model. So when you create  a new user it will automatically creates a contact in res.partner table.

For more about this:https://www.youtube.com/watch?v=CkUulwB6k3o

Thanks

Avatar
Discard
Author

Hi Niyas,
i understood the inherits part, but the doubt is how can i remove that functionality in my module. i don't want to create a vendor while creating the user. Can you Please write the code structure here ?
Thank you :)

Best Answer

Hi Ashutosh,

You can't create a user without a related partner. This is because the User model is an extension of the Partner model.  Basically, when you fill in the user form and click on save, A partner record is first created to hold the general information like the name of the user, profile picture, the user language, email, Tax ID, addresses...and any other general information that will be updated in the future. To confirm this, you can try changing the name of the partner and you will notice that the name of the linked user also changes. 

The user model is dedicated to storing the technical data only like username, password, login history, groups (access rights), etc. Think of the Partner model as the blueprint for the user model.


Avatar
Discard
Related Posts Replies Views Activity
0
Sep 22
1393
2
Sep 24
1840
1
Nov 23
1976
2
Feb 22
1488
2
Dec 24
3132