Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda

<template id="general_ledger_detailed_pdf_template" name="Web Report Detailed Page">

​ <t t-call="web.basic_layout">

​ <div class="header">

​ <t t-if="not o" t-set="o" t-value="docs"/>

​ <t t-if="not company">

​ <t t-if="company_id">

​ <t t-set="company" t-value="company_id"/>

​ </t>

​ <t t-elif="o and 'company_id' in o and o.company_id.sudo()">

​ <t t-set="company" t-value="o.company_id.sudo()"/>

​ </t>

​ <t t-else="else">

​ <t t-set="company" t-value="res_company"/>

​ </t>

​ </t>

​ <div style="padding-top: 5px; border-bottom: 1px solid #000;">

​ <div>

​ <h6 class="text-center text-uppercase font-weight-bold">

​ <span t-esc="company.name"/>

​ </h6>

​ <h5 class="text-center text-uppercase text-decoration-underline font-weight-bold"><u><t t-out="report.get_title()"/></u></h5>

​ <div t-if="options.get('filter_date')" class="h6 font-weight-bold text-center p-0 m-0 mb-2">

​ <span t-out="report._get_report_title(options)"/>

​ </div>

​ </div>

​ </div>

​ </div>

​ <div class="page" style="padding: 40px;">

​ <t t-if="not o" t-set="o" t-value="docs"/>

​ <t t-if="not company">

​ <t t-if="company_id">

​ <t t-set="company" t-value="company_id"/>

​ </t>

​ <t t-elif="o and 'company_id' in o and o.company_id.sudo()">

​ <t t-set="company" t-value="o.company_id.sudo()"/>

​ </t>

​ <t t-else="else">

​ <t t-set="company" t-value="res_company"/>

​ </t>

​ </t>

​ <table class="table ics_report_main_table" style="width: 100%; color: #000000;">

​ <t t-set="group_headers" t-value="options.get('report_header_groups', [])"/>

​ <t t-set="headers" t-value="options.get('headers', [])"/>

​ <thead style="display: table-header-group;">

​ <tr t-if="options.get('filter_date') and len(group_headers) &gt; 1">

​ <th class="bg-300"></th>

​ <th t-foreach="group_headers" t-as="group_header" t-att-colspan="len(headers)" class="text-center bg-300" style="padding: 3px !important;">

​ <t t-out="group_headers[group_header].get('string')"/>

​ </th>

​ </tr>

​ <tr class="group_header" t-if="options.get('group_column')">

​ <th class="bg-300"></th>

​ <t t-set="header_group_id" t-value=""/>

​ <th t-foreach="headers" t-as="header" t-att-colspan="header.get('col_group_length')" class="bg-300" t-if="header.get('group_id') != header_group_id">

​ <t t-esc="header.get('group_string')"/>

​ <t t-set="header_group_id" t-value="header.get('group_id')"/>

​ </th>

​ </tr>

​ <tr>

​ <th class="bg-300"></th>

​ <t t-foreach="group_headers" t-as="group_header">

​ <t t-foreach="headers" t-as="header" t-key="header_key">

​ <t t-if="header['column_visible']">

​ <th class="bg-300" style="padding: 3px !important;">

​ <span><t t-out="header['string']"/></span>

​ </th>

​ </t>

​ </t>

​ </t>

​ </tr>

​ </thead>

​ <tbody style="display: table-row-group;">

​ <t t-foreach="section_lines" t-as="parent_section">

​ <t t-if="parent_section.get('row_class') != 'ics_group_total'">

​ <t t-set="additional_lines" t-value="report.get_web_report_section_data(parent_section, options)"/>

​ <t t-set="section_lines" t-value="[parent_section] + (additional_lines if additional_lines else [])"/>

​ <t t-foreach="section_lines" t-as="line" t-foreach-index="line_index">

​ <t t-set="line_class" t-value="line.get('row_class', '')"/>

​ <tr t-attf-class="

​ ics_report_base_line_level_{{ line['level'] }}

​ {{ 'bg-300' if line['level'] == 0 and not line_class else '' }}

​ {{ (line_class + ' bg-300') if line_class and len(report.line_ids) == 1 else '' }}">

​ <!-- Title Column -->

​ <t t-if="line_index == 0">

​ <td class="text-black" style="padding: 4px!important; font-weight: bold;">

​ <strong t-out="line['title']"/>

​ </td>

​ </t>

​ <t t-else="">

​ <td class="text-black" t-att-style="'font-weight: normal; padding-left: %dpx;' % (10 * (line.get('level')))">

​ <span t-out="line['title']"/>

​ </td>

​ </t>

​ <!-- Value Columns -->

​ <t t-foreach="group_headers" t-as="group_header">

​ <t t-foreach="headers" t-as="header" t-key="header">

​ <t t-if="header['column_visible']">

​ <t t-set="value_dict" t-value="line.get('values', {}).get(group_header, {})"/>

​ <t t-set="cell_value" t-value="value_dict.get(header['expression_label'], '')"/>

​ <t t-set="is_zero" t-value="value_dict.get(header['expression_label'] + '_is_zero', '')"/>

​ <t t-set="main_group" t-value="line.get('values', {}).get('main_group', {})"/>

​ <td style="padding: 4px!important;"

​ t-attf-class="ics_column_value {{header['value_type']}} ics_report_base_line_level_{{line['level']}}

​ {{is_zero and 'ics_zero_value' or ''}}

​ {{header['hide_if_zero'] and 'ics_hide_zero' or ''}}

​ {{main_group.get('column_value_hide') and line_class != 'ics_group_total' and 'column_value_hide' or ''}}">

​ <span t-out="cell_value"/>

​ </td>

​ </t>

​ </t>

​ </t>

​ </tr>


​ <!-- Handle children if any -->

​ <t t-if="line.get('children')">

​ <t t-call="ics_report_base.section_child_lines"/>

​ </t>

​ </t>

​ </t>

​ </t>

​ </tbody>

​ </table>

​ </div>

​ <!-- Repeating footer for PDF rendering -->

​ <div class="footer o_footer">

​ <div style="border-top: 1px solid #000; padding-top: 5px; width: 100%; text-align: center; font-size: 12px;">

​ <div>

​ <span t-esc="report.env.company.name"/>,

​ <span t-esc="report.env.company.street"/>,

​ <span t-esc="report.env.company.city"/>,

​ <span t-esc="report.env.company.zip"/>,

​ <span t-esc="report.env.company.country_id.name"/>

​ </div>

​ <div style="margin-top: 3px;">

​ Page <span class="page"/> of <span class="topage"/>

​ </div>

​ </div>

​ </div>

​ </t>

</template>

I am currently working on the report template and am satisfied with its overall structure. However, I have a requirement that the table header should repeat on every page.

Could you please provide guidance on the necessary modifications to the existing template to meet this requirement? Your expertise would be greatly appreciated.

Thank you for your assistance.

Avatar
Buang
Jawaban Terbai

Hi,

Please refer to the module - https://apps.odoo.com/apps/modules/9.0/report_qweb_element_page_visibility

You can find all the latest versions from v8 to v18.


Hope it helps.   

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
1
Jul 23
2807
1
Mei 23
2570
2
Agu 16
5516
2
Jun 25
1947
0
Jan 25
1039