Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
7233 Переглядів

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


Аватар
Відмінити
Найкраща відповідь

UPDATED FOR ODOO 17:


Hi,

Please try with this

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

Аватар
Відмінити
Автор

nice, this works!

Related Posts Відповіді Переглядів Дія
1
лют. 24
2694
1
лип. 23
3568
0
квіт. 23
91
1
лист. 22
2275
3
груд. 23
19265