Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
2556 Vistas

I have a field called 'Customer' in the CRM module that links to records in the Contacts module. Additionally, I have another field called 'Site' that links to records in the Site module.

In the Contacts module there is a manyToMany field that connects to the site module.

Currently, all fields are working fine. However, I want to enhance the 'Site'  field in the CRM so that it only displays sites related to the selected 'Customer'.

I'm using Odoo Studio (web version) for this customization. Could anyone provide detailed steps or a solution on how to achieve this filtering?

Avatar
Descartar
Mejor respuesta

Hi Michael: You will not be able to do it within Studio since the domain builder in Studio does not allow domains that reference a field. You will need to customize the CRM view and add domain="[('partner_ids.id', '=', partner_id)]" to the "sites" field in the CRM form.

Avatar
Descartar
Mejor respuesta

Hello Michael Spitzer,

Step 1: First let's create new field(many2many) called "site" in contact model.


Step 2:  Let's Add new  field many2many related to site model's site field. we can make this invisible, use of this field is only for apply domain in crm model.





Step 3: Add New site field many2many in crm model with domain of field created in step2 as below



Final result : site field in crm will have option based on customer's related site.




I have attached video for more details. please have a look



Thanks & Regards,

CandidRoot Solutions Pvt. Ltd.

Mobile: (+91) 8849036209

Email: info@candidroot.com

Avatar
Descartar
Autor

Thank you! In step 2 how do i get the many2many field to contain only the sites that are related to this contact?

Helo Michael,

I have recored video with an example. please have a look.

https://youtu.be/B56UWHvUZz8

Publicaciones relacionadas Respuestas Vistas Actividad
0
ago 20
2198
1
abr 20
7359
0
jun 23
1814
0
jul 22
1520
1
dic 20
3206