콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
939 화면

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.

아바타
취소

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

베스트 답변

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



아바타
취소
관련 게시물 답글 화면 활동
3
9월 25
247
1
9월 25
914
1
9월 25
212
3
9월 25
219
2
9월 25
345