Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
20613 Vues

I'm a little bit confused how does res.partner and res.user related by default? 

if we have something like this

    class OpStudent(models.Model):

    _name = 'op.student'

    _inherits = {'res.partner': 'partner_id'}

    middle_name = fields.Char('Middle Name', size=128)

    last_name = fields.Char('Last Name', size=128, required=True)

    birth_date = fields.Date('Birth Date', required=True)


does it means it creates user automatically when we create student. 

Avatar
Ignorer
Meilleure réponse

Hi Andrew,
The relationship between 
res.partner and res.user is that res.user inherits from res.partner using an inheritance type called "Delegation Inheritance", See This


Actually only res.users has a "real" relationship to res.partner, because with every user odoo will create a partner (per default no customer and no supplier). this partner will be used e.g. for emails and the followers system in odoo.

But you can have partners without users, too. That will be a normal partner, for defining customers and suppliers.


Avatar
Ignorer
Auteur

So what is this line of code doing. _inherits = {'res.partner': 'partner_id'} it means that i'm creating my model inside res.partner or how does it work exactly. still trying to figure it out. Thank you for replay.

Publications associées Réponses Vues Activité
2
févr. 23
6293
2
févr. 16
14344
1
août 19
5946
1
avr. 25
1244
0
déc. 20
4980