Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
2569 Lượt xem

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?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Tác giả

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

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 8 20
2199
1
thg 4 20
7367
0
thg 6 23
1825
0
thg 7 22
1536
1
thg 12 20
3211