コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
7254 ビュー

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!

関連投稿 返信 ビュー 活動
1
2月 24
2697
1
7月 23
3579
0
4月 23
91
1
11月 22
2276
3
12月 23
19269