Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
341 Visualizzazioni

Hello,

I'm working with Odoo 18 enterprise and have installed the partner_multi_relation module from the OCA repository. This module allows flexible management of relationships between contacts and adds a smart button called "Relations" in the contact form view, which opens a view listing those relations.

What I would like to do is to extend or customize this behavior so that the relationships are displayed in a notebook tab directly within the contact form, instead of relying solely on the smart button.

I'm planning to create a custom module to achieve this. Could anyone guide me on how to do this or point me to a similar existing implementation? Any example or suggestions on how to extend the contact form view to include this relationship list would be greatly appreciated.

Thanks in advance for your help!


Repository of partner_multi_relation: https://github.com/OCA/partner-contact/tree/6f4caf2ae929a7b976ec594b98bb5eb83c4bd450/partner_multi_relation

Avatar
Abbandona
Autore Risposta migliore

Thanks for the links! They were helpful to understand how to add notebook tabs in the contact form.

I’ve successfully added a new tab, but now I’m trying to display the partner relationships (from the partner_multi_relation module) inside that tab. The challenge I'm facing is how to link the related model (res.partner.relation) to the contact form, since it's a separate model and not directly defined as a One2many in res.partner.

I see that the relationships use left_partner_id and right_partner_id, but I'm not sure how to show them in the tab contextually for each contact.

Do I need to define a computed One2many field in res.partner to show all related res.partner.relation records for that partner? Or is there a recommended way to inherit the view and filter only the relevant relations?

Any guidance or example would be really appreciated!

Avatar
Abbandona
Risposta migliore

Hi,


Refer to the following.


- https://www.youtube.com/watch?v=MAfHxynsQPI


For more information - https://www.youtube.com/watch?v=lQRajGzEpWs


Hope it helps

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
lug 25
1436
3
nov 24
5045
3
nov 23
7966
1
apr 23
2849
1
ago 25
226