تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
7242 أدوات العرض

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
فبراير 24
2697
1
يوليو 23
3571
0
أبريل 23
91
1
نوفمبر 22
2276
3
ديسمبر 23
19267