Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
2659 Tampilan

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
Buang
Jawaban Terbai

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
Buang
Jawaban Terbai

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
Buang
Penulis

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

Post Terkait Replies Tampilan Aktivitas
0
Agu 20
2229
1
Apr 20
7410
0
Jun 23
1889
0
Jul 22
1572
1
Des 20
3277