Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
20596 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
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 Odpovědi Zobrazení Aktivita
2
úno 23
6271
2
úno 16
14334
1
srp 19
5927
1
dub 25
1235
0
pro 20
4962