This question has been flagged
5 Replies
4835 Views

How can I filter the list of customers to show customers who do not have a confirmed sales order in the last 30 days?  I was trying to use a filter domain but I don't know how to include the related field of sale.order, I can only filter on fields within res.partner. 

It would especially nice if I could color code the customer list by date of their last order, example: customers whose last order is older than 30days=yellow / 60days=orange / 90days = red.  Can anyone point me in the right direction how to do this?  Thank you.

Odoo 10 CE


Avatar
Discard
Best Answer

Have you found a solution for your problem i am having the same problem.

kind regards.

Avatar
Discard
Author Best Answer

This is a filter for sales orders which shows me orders within 30 days.  Again, I am trying to show a list of customers who do not have any active orders within a specified time period.  I can run a filter on sales orders older than 30 days, and group by customer, but this doesnt help because it will still include customers which might have an active order from 1-2 days ago, it will just only show their old orders.  I hope this makes sense.



Avatar
Discard
Best Answer
<filter string="Last 30 Days" name="prev_month" domain="[('date_order','&gt;=',(context_today()-relativedelta(months=1)).strftime('%Y-%m-01')),('date_order','&lt;',time.strftime('%Y-%m-01'))]"/>

Add this filter in your search view in sale order.check this :), I've changed my answer.but this will only filtered last 30 days customers.

 

Avatar
Discard
Author

Ok that looks like a filter to show order fron "today". How does this help in the context of my question?

check as above.