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

Hello,

I want to use server actions to send mail in different steps of a workflow.

I can send mail, however impossible to change the format of date of to translate the terms in the mail.

For instance in my mail if I try to use:

[[ formatLang(object.date_from,date=True) ]]

I get this error:

   openerp.tools.safe_eval: Cannot eval 'formatLang(object.date_from,date=True)'

Same problem if I try to use:

  [[ _(object.employee_id.name) ]]

Do someone find a solution to format mail or translate terms in server actions?

Thanks by advance for your help.

อวตาร
ละทิ้ง

I would expect a syntax more like this: &nbsp;&nbsp;Date: ${formatLang(object.date_order,date=True)}<br />. Nevertheless, it doesn't work on my side too

คำตอบที่ดีที่สุด

You can do the following solution

Replace: ${object.datetime_field}

With: ${object.datetime_field.split(' ')[0]}

and you can play with as needed.

OR ALSO:

You can view this link to know how to change email templates date format: 

https://www.odoo.com/forum/help-1/question/how-to-change-email-templates-date-format-15885

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

I contacted OpenERP and the answer is: 'It is not possible with the current framework'

I hope it will be added in future release....

อวตาร
ละทิ้ง

+1 new hoping user! :)

Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ธ.ค. 24
1466
3
พ.ค. 24
2026
1
ก.พ. 24
4047
1
ธ.ค. 23
2355
2
เม.ย. 23
2134