Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
1111 Widoki

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.

Awatar
Odrzuć

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

Najlepsza odpowiedź

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



Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
paź 25
82
0
paź 25
196
3
paź 25
348
0
paź 25
8
0
paź 25
235