I'd like to have a dashboard that shows me (for example) QC Inspections that were created in the current month. Is there a way to filter dates this way?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Księgowość
- Zapasy
- PoS
- Project
- MRP
To pytanie dostało ostrzeżenie
It should work... Let us know ...
[('create_date', '>', (datetime.datetime.now()).strftime('%Y-%m-01') )]
1 - Go to the listing where you want to add a filter.
2 - Open Studio, and add a new filtrer.
Define any filter domain. Not important now.
We don't care about the values filtered, because we will edit later.
This will create a new vue with this filter.
3 - Activate the developper mode, and access to the Vues.
Filter to the vues with date created = today to find your last view.
If you edit a filter in the quotations, you will find a view inherited to
sale.order.search.inherit.quotation
4 - Edit the view and put exactly what you want.
For example : filter on last 7 days
string="7 derniers jours"
domain="[("date_order","=",(datetime.date.today()-datetime.timedelta(days=7)).strftime("%Y-%m-%d 00:00:00"))]"/>
Inside the domain, you need to write in html.
For example "e instead of " or > instead of >
Hello,
Try this
<filter icon="terp-check" string="Current Date" name="current_date" domain="[('date','=',((context_today()).strftime('%%Y-%%m-%%d')))]"/>
hope it help
Add a filter to your view similar to this one...
<filter icon="terp-go-today" string="This Month" domain="[('date','<=',context_today().strftime('%%Y-%%m-%%d')),('date','>=',context_today().strftime('%%Y-%%m-01'))]"/>
You need context_today to use the "user" timezone" when calculating the dates...
Podoba Ci się ta dyskusja? Dołącz do niej!
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ść | |
---|---|---|---|---|
|
2
mar 25
|
5928 | ||
|
0
gru 24
|
1020 | ||
|
2
sty 24
|
1751 | ||
|
1
wrz 23
|
1411 | ||
|
0
lut 25
|
1423 |