Skip to content

Commit 81a1488

Browse files
author
Milan Topuzov
committed
search: use dynamic datetime macros for date_created filters (now -1d/-7d/-30d) per core v19 behavior
1 parent 82d62a1 commit 81a1488

1 file changed

Lines changed: 16 additions & 4 deletions

File tree

queue_job/views/queue_job_views.xml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,22 @@
253253
domain="[('retry', '>', 1)]"
254254
/>
255255
<separator />
256-
<!-- Odoo 19: removed date range filters.
257-
Reason: the v19 RNG forbids Python expressions in search domains
258-
(e.g., context_today() - datetime.timedelta(...)).
259-
Use custom actions or saved filters for quick date ranges. -->
256+
<!-- Quick datetime ranges using dynamic macros -->
257+
<filter
258+
name="last_24_hours"
259+
string="Last 24 hours"
260+
domain="[('date_created', '&gt;=', 'now -1d')]"
261+
/>
262+
<filter
263+
name="last_7_days"
264+
string="Last 7 days"
265+
domain="[('date_created', '&gt;=', 'now -7d')]"
266+
/>
267+
<filter
268+
name="last_30_days"
269+
string="Last 30 days"
270+
domain="[('date_created', '&gt;=', 'now -30d')]"
271+
/>
260272
<separator />
261273
<!-- Odoo 19: no <group expand> in search; declare group-by filters inline -->
262274
<filter

0 commit comments

Comments
 (0)