Skip to Content
Menu
This question has been flagged

i am using this code to make a pdf report of list view but when i print this it print the same page multiple times means if i select 3 line it print 3 pages of same data if i select 4 lines it print 4 pages of same data

<data>

    <xpath expr="/t[@t-name='studio_report_document']" position="replace" mode="inner">

        <t t-call="web.external_layout">

            <div class="page">

                <div class="row mt8">

                    <div class="col-lg-12">

                        <h2>Sitara Test Report</h2>

                    </div>

                </div>

                <div class="row mt8">

                    <div class="col-12">

                        <table class="table table-borderless">

                            <thead>

                                <tr>

                                    <th class="text-start align-middle">Date</th>

                                    <th class="text-start align-middle">Description</th>

                                    <th class="text-start align-middle">Chakk</th>

                                    <th class="text-start align-middle">Company</th>

                                    <th class="text-end">Amount</th>

                                </tr>

                            </thead>

                            <tbody>

                                <tr t-foreach="docs" t-as="line" t-att-style="'background-color: #F1F1F1;' if line_index % 2 == 0 else ''">

                                    <td class="align-middle">

                                        <span t-field="line.date">2023-08-15</span>

                                    </td>

                                    <td class="align-middle">

                                        <span t-field="line.name">Name</span>

                                    </td>

                                    <td class="align-middle">

                                        <span t-field="line.x_plan2_id">Chakk</span>

                                    </td>

                                    <td class="align-middle">

                                        <span t-field="line.company_id">Sitara</span>

                                    </td>

                                    <td class="text-end align-middle">

                                        <span t-field="line.amount">10000</span>

                                    </td>

                                </tr>

                                <tr>

                                    <td class="text-end" colspan="5">

                                        <strong>

                                            <span style="margin-right: 15px;">Total</span>

                                            <span t-out="sum(docs.mapped('amount'))">50000</span>

                                        </strong>

                                    </td>

                                </tr>

                            </tbody>

                        </table>

                    </div>

                </div>

            </div>

        </t>

    </xpath>

</data>

Avatar
Discard
Related Posts Replies Views Activity
2
Jun 24
2006
1
Jun 24
1282
2
Aug 24
1412
0
Jul 24
428
1
May 25
202