İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
10278 Görünümler

Hi all,

i'm reading about "delegation inheritance" in "Odoo 10 Developments essentials" book.

In the example there is:

```

from odoo import Model, fields

class User(models.Model):

    _name="res.users"

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

    partner_id = fields.Many2one("res.partner")

```

in this example I don't know why there is M20 in "partner_id" field.

I agree that to a user corresponds only one "res_partner" but I don't understand why to a "partner" can correponds many users.

Anyone can help me to understand?

Avatar
Vazgeç
Üretici

Hilar AK thanks for your answer,

I think the answer is "this is actually setting relation". Could you explain it better?

My doubt is why to a partner can correpond many users.... Is there this possibility in oddo interface? If yes, where?

En İyi Yanıt

This is actually setting relation, where the targeted model's fields are now accessible through this relation. We can have multiple inheritances and the new table created in DB contains your new fields and fields which delegates the inherited object fields (fields storing IDs from inherited tables.

reference: 

https://www.odoo.com/documentation/12.0/reference/orm.html#delegation

https://www.odoo.com/forum/help-1/question/delegation-inheritance-in-odoo-v8-when-is-it-useful-84890

Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
2
Tem 25
4662
2
Ara 24
7790
2
Kas 24
28567
2
May 24
7506
3
Mar 24
6926