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

how to use ref in filter domains?

this does not work

<filter string="service" domain="[('service_ids', 'in', ref('service.service_1')]"/>

neither does this

<filter string="service" domain="[('service_ids', 'in', %(service.service_1)d)]"/>

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất
I'm using this and works fine.

<
filter string="Ecuadorian States" name="ecuadorian_states" domain="[('country_id', '=', %(base.ec)d)]"/>


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

Thanks for your reply,

Any workaround to hardcode it in the xml?

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

Hi ,

Go to the module you want to create the filter for . 

Now create a view/ Filter the save it.(You can only create a view with the given fields in filter list.)

Now go to user define filter . you can find the view .if you want you can change it there as well.

Ps - there are some fields you cannot see in the custom filter list initially. You can add the fields using studio.

Hope this helps.

Srijita Banerjee

Jr. Odoo Consultant

Tel: +353 1 886 5684 (IE) +44 121 285 5684 (UK)  +91 964 381 7554 (IN)

 

Target Integration | CRM ERP Cloud

Website | LinkedIn | Twitter | Facebook | YouTube | Instagram

.


Ảnh đại diện
Huỷ bỏ