Help

3

How to show many2many field's value in Email Template using jinja2 ?

Avatar
mahi

i want to show values of many2many field by jinja 2,

intrested_in = fields.Many2many('intrested.property', string='Intrested In')

class intrestedProperty(models.Model):

    _name = 'intrested.property'

    _rec_name = 'intrested_in'

    intrested_in = fields.Char('Intrested In')

i write a code liike -

INTERESTED IN : ${object.intrested_in}  

Gives output :

INTERESTED IN : intrested.property(1,)

2 Comments
Avatar
Discard

You need to loop over the records first before printing values. You're literally printing the object (so a record or recordset) instead of a field value.

Avatar
mahi
-

How to make a for loop in Jinja?