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

Hi all, I would like to add the customer name to the Notification E-Mail template for sale orders. While I see that the message model stores the document id in res_id, I don't know how to access data stored in another model. Searching the forum and looking at API documentation made me hope something like this would work:

${object.env['sale.order'].search([('id', '=', res_id)])[0].partner_id}


Unfortunately, it doesn't. So any help is greatly appreciated.

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

Hello Jan Beckhoff,

You can see the various example to print customers and others fields value into the email body through 

Menu: Setting => Technical => Email => Templates
Here you can see the all the Email template along with your email template.

we can add a customer to the message body by using Dear ${object.partner_id.name} 

Thanks 

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

Thanks for your reply but the related model is message and doesn't have partner_id or any information about the customer stored aside from the document id...

When we send email from sale order it will create one mail.message record that contains Email body part as a message

so if email template body have customer name it will display in message.

Tác giả

Maybe misunderstandable but I was talking about Notification E-Mail Template - the one that sends chatter messages via mail.

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 6 17
4493
0
thg 5 16
3980
1
thg 8 25
486
1
thg 6 25
1338
1
thg 6 25
1015