Shravy
Shravy

Reputation: 666

How to print a one2many field values in qweb report in Odoo?

I am trying to print a one2many field values one by one separated by comma,

<div class="col-xs-3">
<strong>Attendees:</strong>
<p t-esc="o.matp.empname"/>
</div>

How can i achieve this and also wanted to print values separated by comma?

Upvotes: 1

Views: 3962

Answers (2)

Jainik Patel
Jainik Patel

Reputation: 2324

Try this code :

<t t-foreach='o.matp' t-as='value'>
      <t t-esc="value.empname"/>,
</t>

Upvotes: 6

Hardik Patadia
Hardik Patadia

Reputation: 1999

You can define a function in your parser of qweb report and call that function from report, which returns a comma separated list of values to your report.

Upvotes: 2

Related Questions