Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
7248 Lượt xem

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


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

UPDATED FOR ODOO 17:


Hi,

Please try with this

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

Ảnh đại diện
Huỷ bỏ
Tác giả

nice, this works!

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 2 24
2697
1
thg 7 23
3575
0
thg 4 23
91
1
thg 11 22
2276
3
thg 12 23
19267