Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
2557 Переглядів

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?

Аватар
Відмінити
Найкраща відповідь

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.

Аватар
Відмінити
Найкраща відповідь

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

Аватар
Відмінити
Автор

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

Related Posts Відповіді Переглядів Дія
0
серп. 20
2198
1
квіт. 20
7360
0
черв. 23
1814
0
лип. 22
1520
1
груд. 20
3206