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

Hello,

Here is my problem

I created a m2m fields between 2 models A and B with the comodel C

And i defined this comodel C to add additionnal fields (date,etc...)

On the form of model A, i added a page to display my m2m

It works but i can display only fields from model B

How is it possible to display other columns with additionnal fields from comodel C

Avatar
Vazgeç
Üretici En İyi Yanıt

Finally found the solution alone

Need to add a one2many linked to the comodel and with a depends to the m2m

And the m2m have a depends too to the o2m

ex:

s_partner_role_ids = fields.Many2many('res.partner', 's_partner_role_partner',

                                          column1 = 's_partner1_id', column2 = 's_partner2_id',

                                          string = "Liens Fils", copy = False, depends=['s_role_ids'])

s_role_ids = fields.One2many('s.partner.role.partner', 's_partner2_id', 'Rôles',

                                 auto_join=True, copy=False, depends=['s_partner_role_ids'])

Avatar
Vazgeç