Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
1 Responder
7255 Visualizações

is there a way to add the current date to the attachement name in the email template?


In the QWeb Reports it's possible to add the (time) from python, but in the e-mail it's not working. Any tips or solutions on this?

(object.state in ('draft', 'sent') and 'Invoice_%s_' % (object.name) +time.strftime('%d.%m.%Y')) or 'Invoice%s_'% (object.name) +time.strftime('%d.%m.%Y')

Thanks


Avatar
Cancelar
Melhor resposta

UPDATED FOR ODOO 17:


Hi,

Please try with this

${datetime.datetime.now().strftime('%d.%m.%Y')}

Avatar
Cancelar
Autor

nice, this works!

Publicações relacionadas Respostas Visualizações Atividade
1
fev. 24
2699
1
jul. 23
3579
0
abr. 23
91
1
nov. 22
2277
3
dez. 23
19270