Hello, When creating a filter in the client, how can I indicate in the domain to filter on the stock moves before (the date of today - 10 days) for example? I tried different expressions but that didn't work. Thanks.
stock.move uses a timestamp value for field
date. The following domain should return all moves where the date is earlier than
today - 10 days:
I assume, that you use the domain in a window action. If you want to use it in a view, you should use
<= instead of
Hello, you used the context_today () like domain in the model and it works perfectly, but I try to do it with a datetime field and shows me an error message.
The code I use is
'agenda_id': fields.many2one ('delphos.citamedica.agenda', 'Agenda', required = True, domain = "[('doctor_id', '=', doctor_id), ('date', '> =', ((context_today ()). strftime ('% Y-% m-% d% H:% m:% S'))), ('date_deadline', '<=', ((context_today ()). strftime ('% Y-% m-% d% H:% m:% S')))] "),
The error message says: Uncaught Error: ValueError: No known conversion for% H
That could be my mistake?
[('date', '>=', (context_today() - datetime.timedelta(10)).strftime('%%Y-%%m-%%d') )]
The only expression that works is:
[('move_ids.date', '=' , (time.strftime('%Y-%m-%d'))]
I don't know how to integrate delay in it.