跳至内容
菜单
此问题已终结
3 回复
2736 查看

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)]"/>

形象
丢弃
最佳答案
I'm using this and works fine.

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


形象
丢弃
编写者 最佳答案

Thanks for your reply,

Any workaround to hardcode it in the xml?

形象
丢弃
最佳答案

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

.


形象
丢弃