Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
20603 Vizualizări

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. 

Imagine profil
Abandonează
Cel mai bun răspuns

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.


Imagine profil
Abandonează
Autor

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.

Related Posts Răspunsuri Vizualizări Activitate
2
feb. 23
6281
2
feb. 16
14337
1
aug. 19
5934
1
apr. 25
1237
0
dec. 20
4967