İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
931 Görünümler

Hello Odoo Community Team,

Currently, I am working on the configuration of Odoo in my localhost environment, focusing on the following modules:

  • Sales
  • CRM
  • Invoicing

I am facing an issue with the Sales module. When I generate a quotation, the PDF output becomes 7 pages long, even though the actual content is only 4 pages. The additional pages are appearing due to unnecessary spacing, which is causing layout issues.

I would appreciate any guidance or suggestions on how to resolve this issue within the Odoo Community Edition.

Please let me know if any specific changes are needed in the report template or if there’s a recommended workaround.

Looking forward to your support.

Avatar
Vazgeç

Have you made any customisations to the PDF Quote? If so, please mention that as well. Thank you

En İyi Yanıt

Hi,


The extra blank pages in the Sales Quotation report usually happen because of spacing inside the QWeb template. you can solve it directly in the XML template.


Reduce font size and padding with inline styles:


<td t-att-style="'font-size:11px; padding:2px;'">

   <span t-field="line.product_id.display_name"/>

</td>

<td t-att-style="'font-size:10px; padding:2px;'">

   <span t-field="line.price_unit"/>

</td>


Remove or condition empty blocks so they don’t push content down:


<div t-if="o.note">

   <p t-field="o.note" t-att-style="'margin:0; font-size:11px;'"/>

</div>




Example of an override in a custom module:


<template id="report_saleorder_document_inherit" inherit_id="sale.report_saleorder_document">

   <xpath expr="//table[@class='table table-sm o_main_table']/tbody/tr/td" position="attributes">

<attribute name="t-att-style">'font-size:10px; padding:2px;'</attribute>

   </xpath>

</template>


With these adjustments, the quotation PDF will shrink to the real number of pages (e.g. 4 instead of 7) without large blank spaces.



Hope it helps



Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
1
Eyl 25
866
1
Eyl 25
163
3
Eyl 25
179
2
Eyl 25
288
2
Ağu 25
633