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

I'm trying to filter one2many records based on current date. This is my xml code

    <field name="record_ids" domain="[('end_date', '>', cur_date)]">

        <tree string="records_tree">

                <field name="record_id"/>

                <field name="record"/>

                <field name="start_date"/>

                <field name="end_date"/>

        </tree>

    </field>

cur_date is a functional field I added to get current date.

My problem is records are not filtered in the view. Also it doesn't show any error message

الصورة الرمزية
إهمال
أفضل إجابة

You can get current date for your domain like this:

domain="[('end_date','&gt;',context_today().strftime('%%Y-%%m-%%d'))]" 

more examples: filter-by-date-of-today-with-a-delay

الصورة الرمزية
إهمال
الكاتب

Hi. Thanks for the answer. I added this domain to view. Its still shows records without filtration

المنشورات ذات الصلة الردود أدوات العرض النشاط
3
يوليو 15
33142
0
مارس 15
3626
1
يونيو 22
13393
1
يونيو 22
7385
0
أكتوبر 17
3381