Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
2576 Widoki

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?

Awatar
Odrzuć
Najlepsza odpowiedź

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.

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
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

Powiązane posty Odpowiedzi Widoki Czynność
0
sie 20
2203
1
kwi 20
7368
0
cze 23
1832
0
lip 22
1536
1
gru 20
3212