Hello Friends
I'm trying to add a drop down template menu down to note form, so any one know how to do this?
this is the photo below that i would add that selectable template menu
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hello Friends
I'm trying to add a drop down template menu down to note form, so any one know how to do this?
this is the photo below that i would add that selectable template menu
Hello,
Add new email template with your content using the xml. add the template M2O field into the note.note object
inherit the note form view and add that M2O field into the note form.
class note_note(models.Model):
_inherit = 'note.note'
template_id = fields.Many2one('mail.template', string="Template")
@api.onchange('template_id')
def onchange_tempalte(self):
temp_id = self.env.ref('yourmodule.email_temp_id') # where email_temp_id is email template which you add using the xml
body_html = self.env['mail.template'].sudo().render_template(
temp_id.body_html, 'note.note', self.id)
self.memo = body_html
thank you.
@Mitul Shingala
Hi, you know, i dont want to make xml file for each template .. i would use email.template module made templates ... so you think how i should change this part of your suggested code?
temp_id = self.env.ref('yourmodule.email_temp_id') # where email_temp_id is email template which you add using the xml
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
2
thg 3 17
|
6234 | ||
|
0
thg 1 25
|
494 | ||
|
0
thg 4 24
|
1226 | ||
|
4
thg 11 23
|
5205 | ||
|
0
thg 10 23
|
906 |
Creating template using code and send email on button click: https://goo.gl/z16PBZ