Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
526 Lượt xem

Hi,

I changed the default invoice print in odoo17 and its multi company 

<template id="external_layout_standard_inherit" inherit_id="web.external_layout_standard"> i changed this part of header and footer when i print in fire fox it seems fine but when i check in chrome extra line with color red in header and footer how can i remove the unwanted extra lines from the print
so i changed like this
@media print {

h1, p {
orphans: unset;
widows: unset;
display:inline-block
}
} how can i remove that line when i comment the article and footer it will disappear from both side


Thanks in advance

Ảnh đại diện
Huỷ bỏ
Tác giả

Hi , Thank you for your response i tried with these i changed but still same in header and footer its not changingimage0

Update your inherited template like this:
<template id="external_layout_standard_inherit" inherit_id="web.external_layout_standard">
<!-- Remove borders from header -->
<xpath expr="//div[contains(@class, 'header')]" position="attributes">
<attribute name="style">border: none !important; background: none !important; box-shadow: none !important;</attribute>
</xpath>

<!-- Remove borders from footer -->
<xpath expr="//div[contains(@class, 'footer')]" position="attributes">
<attribute name="style">border: none !important; background: none !important; box-shadow: none !important;</attribute>
</xpath>

<!-- Remove border from main article if needed -->
<xpath expr="//article" position="attributes">
<attribute name="style">border: none !important; background: none !important; box-shadow: none !important;</attribute>
</xpath>
</template>
i hope it is solve error

Câu trả lời hay nhất

Hii,
Add the following CSS to your template inside your <template> block:

<style type="text/css">

  @media print {

    header, footer, article {

        border: none !important;

        box-shadow: none !important;

        background: none !important;

    }


    .page, .o_main {

        border: none !important;

        box-shadow: none !important;

    }


    * {

        -webkit-print-color-adjust: exact !important; /* Ensures no browser color override */

        print-color-adjust: exact !important;

    }

  }

</style>

Where to Place It

Add it inside your inherited QWeb template:
<template id="external_layout_standard_inherit" inherit_id="web.external_layout_standard">

    <xpath expr="//head" position="inside">

        <!-- Your CSS here -->

    </xpath>

</template>

i hope it is usefull

Ảnh đại diện
Huỷ bỏ