تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
12495 أدوات العرض

Hi guys,

I've created a module where I put some new category of product that will be created by xml.

So I'have to filter some field with domain, like 'categ_it', '=', xml_id, but i try to eval=ref('xml_id') but without success.

Does anyone have some solution or exampel to suggest me?

I don't want to put normal integer id to filter fileds, I want a more generalized and dynamic option :)

Regards

Franco

الصورة الرمزية
إهمال

I'd love an answer to that as well...

أفضل إجابة

In 8.0 I did the following to make domain based on XML ID:

 

When creating an ir.actions.act_windows

 

        <field name="domain" eval="[('categ_id', '=', ref('xml_id'))]"/>

 

Though, if you need to create a filter you will have to write:

 

          <filter string="My filter" name="my_filter" domain="[('categ_id', '=', %(xml_id)d)]"/>

 

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
0
فبراير 25
18
1
مارس 15
3640
0
مارس 15
3744
2
مارس 15
6775
3
مايو 24
5258