Ir al contenido
Menú
Se marcó esta pregunta
3 Respuestas
18234 Vistas

I am trying to fix the font problem on emailed PS/RFQ pdf's but cannot locate where the css is stored for them as I am assuming that it is css driven.

I cannot upload an example of what I am seeing but it seems that all the text fonts are too large.

for example the shipto box only shows the last 3 lines of the address, the "your company" address is fine but obscures the Invoice address

The font size for the "Request for Quotation #PO0001" header is about 30pt which is far too large


I thought this might be a Centos 8 thing so spun up an Ubuntu 18.04 server using the deb file but its the same on that server as well

System used: 

Odoo 13

Centos 8

Ubuntu 18.04

Background: I have searched but can only find how to create a PO/RFQ from sales, how to create a RFQ/PO template but nothing on how to change the font size displayed in the resultant pdf.

any suggestions is appreciated

Avatar
Descartar
Autor

Have updated Ossi's suggested link with solution

Modify this file for purchase orders Technical -> Views -> report_purchaseorder_document Locate the section

Request for Quotation #

<h4 t-if="o.state in ['sent', 'to approve']">Purchase Order #<span t-field="o.name"/></h4>

<h4 t-if="o.state in ['purchase', 'done']">Purchase Order #<span t-field="o.name"/></h4>

<h4 t-if="o.state == 'cancel'">Cancelled Purchase Order #<span t-field="o.name"/></h4>

For RFQ modify views -> report_purchasequotation_document Request for Quotation

Note these header tags were h2's

Mejor respuesta

You can also use class="small" 

it will also reduce your font size, but if you want to customise font size according to your preferences
You should use style="font-size:16px;"

Thanks me later:) 

Avatar
Descartar
Mejor respuesta

Here is a Quick and Dirty way of resolving the immediate problem.


From Settings -> General -> Business Documents -> Layout, we can see that the invoice / quote PDF is using external_layout_standard QView and Odoo admin can access the XML architecture of this report. However, editing this view as an Odoo admin does not allow access to CSS files where we would be able to modify the layout for good. We can, however, hack this a bit.

Follow the steps:

  1. Settings with Developer mode on -> Edit document layout under Business documents

  2. Look for section

<div class="col-6" name="company_address">
    <div t-field="company.partner_id" t-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;], &quot;no_marker&quot;: true}"/>
</div>

Add Style attribute (style="font-size:14px") for inner <div>:

<div class="col-6" name="company_address">
    <div t-field="company.partner_id" style="font-size:14px" t-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;], &quot;no_marker&quot;: true}"/>
</div>
  1. This changes the sender company address font size. We do still need to change the recipient address font size.
  2. Navigate to Settings -> Technical -> Views (under User interface)
  3. Search for address_layout
  4. Add same style attbute (style="font-size:14px") for section:
<div style="font-size:14px" name="address" t-att-class="colclass">
    <t t-raw="address"/>
</div>

The end result is not the prettiest layout in the world, but it works.

The right way is apparently to inherit 'account.report_invoice_document' and then change the template code. So this is not possible with only Odoo admin UI. It requires writing a small extension.

Stack Overflow has a thread covering the same topic:  https://stackoverflow.com/questions/61398717/odoo-how-to-edit-invoice-quote-layout-css

Avatar
Descartar
Mejor respuesta

An alternative approach is to edit the Paper Format for the relevant formats, and change DPI from 90 to something like 110.  This is like a zoom effect, and makes the text a much more "normal" size.

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
0
mar 21
2142
1
oct 20
4404
1
mar 15
4030
4
ene 17
2876
2
ago 25
137