Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

rendering email template to fields.Html? [Closed]

By
DM
on 6/29/15, 10:34 AM 544 views

The Question has been closed for reason: off-topic or not relevant

by
DM
on 10/23/2015 09:49:20

Hello odoo community,

I was trying to render email template value to fields.Html

I created extension to sales.order module I have two fields i made a onchange function

Fields:

cover_letter=fields.Html('Cover Letter')
template_id=fields.Many2one('email.template', 'Use template'

Function:

@api.onchange('template_id')
def copy_cover_letter(self):
self.ct_cover_letter=self.template_id.body_htm

 

But when i choose template_id, cover_letter gets populated but values i get is with "Hello ${object.partner_id.name},"

Results

Hello ${object.partner_id.name},

Further to your recent email request I am pleased to provide a quotation for the design programme

and supply of your new wireless call system for the first phase extension at Merok House care home. I

am confident that the system designed meets the needs of both your business and those that you

care for.

_________________________________________________________________

But how do i get instead of "Hello ${object.partner_id.name}", something similar to this "Hello 12 Rockliffe Court - Broadacres Housing Associatio" ?
I Seen similar  functionality as on send quotation but not sure how to replicated same behaviour by just rendering template? to my custom field cover_letter=fields.Html('Cover Letter')?

Example:

Hello 12 Rockliffe Court - Broadacres Housing Associatio,

Further to your recent email request I am pleased to provide a quotation for the design programme

and supply of your new wireless call system for the first phase extension at Merok House care home. I

am confident that the system designed meets the needs of both your business and those that you

care for.

Any help and examples would be appreciated!



About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 6/29/15, 10:34 AM
Seen: 544 times
Last updated: 10/23/15, 9:49 AM