Any solutions on how to increase the width of a column on odoo quotation PDF? Example: V Cables under Make column is printing on 2 lines. I want it to be printed on the same line.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Comptabilitat
- Inventari
- PoS
- Project
- MRP
This question has been flagged
Hi,
In Odoo, the quotation and sales order PDF layout is controlled by the report_saleorder_document QWeb template.
In your custom module (or via Studio XML edit), find or inherit:
<template id="report_saleorder_document" inherit_id="sale.report_saleorder_document">
You can directly apply width and nowrap styling to the MAKE column.
<xpath expr="//table[@class='table table-sm o_main_table']/thead/tr/th[2]" position="attributes">
<attribute name="style">width: 120px; white-space: nowrap;</attribute>
</xpath>
<xpath expr="//table[@class='table table-sm o_main_table']/tbody/tr/td[2]" position="attributes">
<attribute name="style">width: 120px; white-space: nowrap;</attribute>
</xpath>
Hope it helps.
Hello Supreeth,
It looks like the content in your "Make" column is wrapping to multiple lines because the default column width is insufficient. Here's how you can adjust the column width in your Odoo quotation PDF:
Understand the Basics: Odoo's PDF reports are generated using QWeb views and often inherit styling from the underlying HTML/CSS.
Customize the QWeb View: You'll need to modify the QWeb view responsible for rendering the quotation PDF. This usually involves locating the relevant template (often named something like 'sale.report_saleorder') in the 'sale' module.
Adjust Column Width: Within the QWeb view, find the <th>
(table header) and <td>
(table data) elements corresponding to the "Make" column. Add or modify the 'width' attribute in the style. For example:
<th style="width: 20%;">Make</th>
<td style="width: 20%;"><t t-esc="line.make"/></td>
Apply Custom CSS (Alternative): You can also define custom CSS rules within your module to override the default styles. This might involve targeting specific classes or IDs associated with the table columns.
Inherit and Modify: Create a custom module to inherit the original QWeb view and apply your changes. This ensures your customizations are preserved during Odoo updates.
For personalized assistance:
https://www.pragtech.co.in/contact-us-mql.html
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Registrar-seRelated Posts | Respostes | Vistes | Activitat | |
---|---|---|---|---|
|
2
d’oct. 25
|
2668 | ||
|
1
d’ag. 25
|
1041 | ||
|
1
d’abr. 25
|
1950 | ||
|
1
de jul. 24
|
2334 | ||
|
1
de maig 24
|
5147 |