Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
7244 มุมมอง

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 ตอบกลับ มุมมอง กิจกรรม
Email Template subject parameters แก้ไขแล้ว
1
ก.พ. 24
2697
1
ก.ค. 23
3571
0
เม.ย. 23
91
how can configured email แก้ไขแล้ว
1
พ.ย. 22
2276
3
ธ.ค. 23
19267