コンテンツへスキップ
メニュー
この質問にフラグが付けられました
3 返信
26503 ビュー

Hi guys,

I want to modify header and footer for external report layout with format European A4

view image https://imgur.com/yJyfS0o

アバター
破棄

I did this exact same thing, if you still need to you can go to the drop down option -Change Footer and with Xpath replace the current footer and header with the values that you want, this way you can leave the original header and footer untouched.

Just paste this inside the <data> tag and add whatever you want

<xpath expr="//div[contains(@t-attf-class, 'header')]" position="replace">

        <div t-attf-class="header o_company_#{company.id}_layout">

            <!-- CUSTOM HEADER HERE -->    

        </div>

    </xpath>

    <xpath expr="//div[contains(@t-attf-class, 'footer')]" position="replace">

        <div  t-attf-class="footer o_standard_footer o_company_#{company.id}_layout" >

          <!-- CUSTOM FOOTER HERE -->

        </div>

    </xpath>

最善の回答

Hello, you can use:


<template id="external_layout_header" inherit_id="report.external_layout_header">
<xpath expr="//div[1]" position="replace">........<xpath/>

<template/>


アバター
破棄
最善の回答

Hi

<template id="external_layout_header" inherit_id="web.external_layout_standard">
<xpath expr="//div[1]" position="replace">........<xpath/>

this is for the header

<template id="external_layout_footer" inherit_id="web.external_layout_standard">
<xpath expr="//div[3]" position="replace">........<xpath/>

this is for the footer


you can make it one template for dry code


アバター
破棄
最善の回答

For future developer (including me). There is no external_layout_header​ in odoo 16. Actually you can check the report xml template in odoo-server\addons\web\views\report_template.xml​.  There you can see which id that giving the pdf a header, a footer, etc

アバター
破棄
関連投稿 返信 ビュー 活動
2
12月 17
3410
5
12月 19
10927
4
10月 18
4673
4
8月 18
6665
4
6月 18
5066