How can I filter all invoices that are due within the next 7 days? I tried the following code and it does not work out:
[['date_due', '<=', time.strftime('%Y-%m-%d %H:%M:%S',time.gmtime(time.time()+7243600))]]
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
How can I filter all invoices that are due within the next 7 days? I tried the following code and it does not work out:
[['date_due', '<=', time.strftime('%Y-%m-%d %H:%M:%S',time.gmtime(time.time()+7243600))]]
hi you should use context_today(), try somethink like:
['&',('date_due','<', ((context_today() + relativedelta(days=7)).strftime('%Y-%m-%d'))),('date_due','>', ((context_today()).strftime('%Y-%m-%d')))]
Unfortunately this does not work out.
['&',('date_due','<', ((context_today() + relativedelta(weeks=0,day=7, weekday=-1)).strftime('%Y-%m-%d'))),('date_due','>', ((context_today()).strftime('%Y-%m-%d')))]
Does show no invoice
[('date_due','<=', ((context_today() + relativedelta(weeks=0,day=7, weekday=-1)).strftime('%Y-%m-%d')))]
Does show only the invoices that are due before today but not the invoices which became due in the next 7 days.
Thanks! I modified it a bit and this works:
[('date_due','<=', ((context_today() + relativedelta(days=7)).strftime('%Y-%m-%d')))]
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj sięPowiązane posty | Odpowiedzi | Widoki | Czynność | |
---|---|---|---|---|
|
0
sty 17
|
3133 | ||
|
1
sie 25
|
17 | ||
|
0
lip 25
|
889 | ||
change between 2 Invoice formats
Rozwiązane
|
|
1
lip 25
|
677 | |
|
2
lip 25
|
783 |