This question has been flagged
2 Replies
4602 Views

There is a filter applied on search view of crm.lead.

Expected closing Warm 1- To fetch all opportunities which have expected closing date between next Monday to Next Sunday. That means if I apply today i.e. on 26/03/2019, It will consider from 01/04/2019 to 07/04/2019.


This filter when applied on Monday gives the result which includes of this week also. (Means this week Monday to Sunday plus next week Monday to Sunday). But I dont want to include this week in this filter.

When I change this filter on Monday I get the correct results. But that is correct only for Monday and that gives wrong results for other days.


So as of now I am using this one to get at least other days correct results.

How to change this filter so as to get the correct results on all days.

Avatar
Discard
Author Best Answer

Can anyone help in this ?


Hi Manish,

This week filter works fine for me on all days.

But Warm 1 filter, warm 2 filter and warm 3 filters are not working only on Monday. 

I forgot to give my filter which I have applied :

XML :

<filter string="Expected Closing Warm 1" domain="['&amp;', ('date_deadline', '&gt;=', ((context_today()+ relativedelta(weeks=0, days=0, weekday=0)).strftime('%%Y-%%m-%%d'))),

('date_deadline', '&lt;=', ((context_today()+ relativedelta(weeks=1, weekday=6)).strftime('%%Y-%%m-%%d')))]" 

help="Expected Closing Warm 1"/>

Avatar
Discard
Best Answer

Hello Sumit,


Just apply filter using create date and use between filter. 

For eg. Create date is between 26/03/2019 to 31/03/2019

Than you get your record.

and if you want to add your own filter than what you want what is requirement.

Below code for 7 days

<filter string="This Week" name="This Week"
domain="[('start_date','&lt;',(context_today()+relativedelta(days=7)).strftime('%Y-%m-%d 23:59:59')), ('start_date','&gt;=',context_today().strftime('%Y-%m-%d 00:00:00'))]"/>

Thanks

Avatar
Discard