Skip to Content
Menu
This question has been flagged
1 Reply
4378 Views

I am having a field username = fields.Many2one('res.partner', String="username")in model1.

  Now i am trying to print a report for model 2.  I need to print the value in this field

now i am able to access  this model1 and print it  but when i am printing as

<t t-foreach="doc.member_name" t-as="o">      <!--to access model1 which is user.info -->
                             <tr>
                                 <td><t t-esc="o.username"/></td>
                                 <td><t t-esc="o.email"/></td>

                             </tr>
                         </t>

in my report i got email field as required but for username i am getting like  res.partner(60,)

Is there any way i could get actual username.


Avatar
Discard
Best Answer

Hi,

Replace this line in the template ,

   <td><t t-esc="o.username"/></td>

as

   <td><t t-esc="o.username.name"/></td>

Thanks

Avatar
Discard
Author

Niyas Raphy,

Thanks for the reply it works.

Related Posts Replies Views Activity
1
Nov 24
18017
1
Sep 23
1200
3
May 23
4088
7
Apr 23
47087
1
Dec 22
6432