Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1098 Zobrazení

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
2
čvn 24
2606
1
čvn 24
1599
2
srp 24
2085
0
čvc 24
682
3
čvc 25
1842