Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
2 Respostas
1845 Visualizações

Hello everyone,

I'm trying to use an automated action to update the date_deadline field on my Opportunity (crm.lead) records to today's date. I'm using the "Execute Python Code" action, but I'm running into some issues.

Here's the code I have so far:

for record in records:

        record['date_deadline'] = date.today()


Could someone please help me with the correct way to update the date_deadline field to today's date within an automated action?

Any help would be greatly appreciated!


I'm using Odoo v17 enterprise online

Avatar
Cancelar
Melhor resposta

Dear Edgaras,

Please use below code 

record['date_deadline'] = datetime.datetime.now().date()



Avatar
Cancelar
Autor Melhor resposta

Dear Ajin,

thanks, it works!

You save my day!

Avatar
Cancelar