Skip to Content
Menu
This question has been flagged
1 Odpoveď
875 Zobrazenia

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
Zrušiť

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

Best Answer

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
Zrušiť
Related Posts Replies Zobrazenia Aktivita
0
sep 25
59
2
sep 25
204
2
aug 25
520
1
aug 25
266
0
aug 25
176