Skip to Content
Menu
This question has been flagged
5 Replies
8856 Views

Hello Community, I hava a problem when I create pdf report in qweb.....

I try this


<t t-set="i" t-value="1" />

<t t-foreach="request.env['x_surat_usul'].search([])" t-as="obj">

    <tr t-foreach="obj.x_pengajuan_materiil" t-as="a">

        <td class="text-center"><span t-esc="i"/><t t-set="i" t-value="i+1"/> </td>

        <td><span t-field="a.x_komponen" /></td>

        <td><span t-field="a.x_jum_ang_approve" /></td>

    </tr>

</t>


It show this result....

Name                Volume

Apple                    2

Manggo                1

Apple                    1

Watermelon        1


I want this result....

Name                Volume

Apple                    3

Manggo                1

Watermelon        1

 Please Help me................


Avatar
Discard

thanks..

but I trying your method, but not working

Can you give me exemple about my Question??


thanks

Would you please post the code which you have tried?

Author

I try this in myCustomize Modul and Report

<t t-set="i" t-value="1" />

<t t-foreach="request.env['x_surat_usul'].search([])" t-as="obj">

<tr t-foreach="obj.x_pengajuan_fasilitas" t-as="a" >

<td class="text-center"><span t-esc="i"/><t t-set="i" t-value="i+1"/> </td>

<td><span t-field="a.x_kategori" /></td>

<td><span t-field="a.x_jum_ang_approve" /></td>

<td></td>

</tr>

</t>

Then show

No   Category      Amount

1       Fasilitas             3

2       Fasilitas             2

3       Rumdin              2


And I want showing

No   Category      Amount

1       Fasilitas             5

2       Rumdin              2


THANKS SUDHIR, YOURE VERY GOOD (:


Best Answer

This is bit technical. You can either use "read_group()" method or just use "SQL Query" and add "GROUP BY" in the query.

Avatar
Discard
Related Posts Replies Views Activity
0
Oct 17
4125
0
Jul 17
2277
2
Aug 22
11988
0
Sep 19
2609
1
Jul 19
8128