Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
3394 Vistas

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
Descartar
Mejor respuesta

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
Descartar
Autor

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 :)

Mejor respuesta

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
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
0
sept 22
1923
2
sept 24
2801
1
nov 23
2803
2
feb 22
1488
1
jun 25
656