跳至内容
菜单
此问题已终结
1 回复
20628 查看

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. 

形象
丢弃
最佳答案

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.


形象
丢弃
编写者

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.

相关帖文 回复 查看 活动
2
2月 23
6309
2
2月 16
14346
1
8月 19
5953
1
4月 25
1245
0
12月 20
4987