Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Artificial Intelligence
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Property Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

QWeb Report <strong> tag not rendering bold text in Odoo 18 PDF report

Subscribe

Get notified when there's activity on this post

This question has been flagged
pdfreport
3 Replies
1685 Views
Avatar
Ashilkrishna
<?xml version="1.0" encoding="utf-8"?>
<odoo>

<template id="report_partnerledger">
<t t-call="web.html_container">
<t t-call="web.internal_layout">
<t t-set="data_report_margin_top" t-value="12"/>
<t t-set="data_report_header_spacing" t-value="9"/>
<t t-set="data_report_dpi" t-value="110"/>
<div class="page">
<h2>Partner Ledger</h2>
<div class="row">
<div class="col-3">
<strong>Company:</strong>
<p t-esc="res_company.name"/>
</div>
<div class="col-3">
<t t-if="data['form']['date_from']">
<strong>Date from :</strong>
<span t-esc="data['form']['date_from']"/>
<br/>
</t>
<t t-if="data['form']['date_to']">
<strong>Date to :</strong>
<span t-esc="data['form']['date_to']"/>
</t>
</div>
<div class="col-3">
<strong>Target Moves:</strong>
<p t-if="data['form']['target_move'] == 'all'">All Entries</p>
<p t-if="data['form']['target_move'] == 'posted'">All Posted Entries</p>
</div>
</div>

<table class="table table-sm table-reports">
<thead>
<tr>
<th>Date</th>
<th>JRNL</th>
<th>Account</th>
<th>Ref</th>
<th>Debit</th>
<th>Credit</th>
<th>Balance</th>
<th t-if="data['form']['amount_currency']">Currency</th>
</tr>
</thead>
<t t-foreach="docs" t-as="o">
<tbody>
<tr style="font-weight:1000 ;background:#f5f5f5;">
<t t-set="currency_total" t-value="sum_currency(data, o)"/>
<td colspan="4">
<strong>
<t t-esc="o.ref"/>
-
<t t-esc="o.name"/>
</strong>
</td>
<td class="text-end">
<strong t-esc="sum_partner(data, o, 'debit')"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</td>
<td class="text-end">
<strong t-esc="sum_partner(data, o, 'credit')"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</td>
<td class="text-end">
<strong t-esc="sum_partner(data, o, 'debit - credit')"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</td>

<td class="text-end" t-if="data['form']['amount_currency']">
<strong t-esc="currency_total['amount']"/>
<t t-esc="currency_total['currency'].symbol"/>
</td>
</tr>

<tr t-foreach="lines(data, o)" t-as="line">

<td>
<span t-esc="line['date']"/>
</td>
<td>
<span t-esc="line['code']"/>
</td>
<td>
<span t-esc="line['a_name']"/>
</td>
<td>
<span t-esc="line['displayed_name']"/>
</td>
<td class="text-end">
<span t-esc="line['debit']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</td>
<td class="text-end">
<span t-esc="line['credit']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</td>
<td class="text-end">
<span t-esc="line['progress']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</td>
<td class="text-end" t-if="data['form']['amount_currency']">
<t t-if="line['currency_id']">
<t t-esc="line['amount_currency']"/>
<t t-esc="line['currency_id'].symbol"/>
</t>
<t t-else="">
-
</t>
</td>
</tr>
</tbody>
</t>
</table>
</div>
</t>
</t>
</template>

</odoo>

However, in the generated PDF report the values are not displayed in bold, even though I used <strong>.

What is the recommended approach in Odoo QWeb reports to make a summary row (like totals or partner header rows) appear bold, especially when using the monetary widget?

i want it look like the second screen shot.

0
Avatar
Discard
Avatar
Jyotin DRKDS INFOTECH
Best Answer
This is a known issue in Odoo 18 PDF reports. The root cause is that **wkhtmltopdf** (or the newer PDF rendering engine) sometimes doesn't properly resolve `<strong>` or `<b>` tags when the font being used doesn't have a bold variant loaded.

**Quick fixes to try:**

1. **Use inline CSS instead of `<strong>`:**
```xml
<span style="font-weight: bold;">Your Text</span>
```
This often works when `<strong>` doesn't.

2. **Explicitly load the bold font variant in your report stylesheet:**
```css
@font-face {
    font-family: 'Your Font';
    font-weight: bold;
    src: url('/path/to/font-bold.ttf');
}
```

3. **Use `font-weight: 700`** instead of `bold` — sometimes the numeric value is parsed more reliably by the PDF renderer:
```xml
<span style="font-weight: 700;">Your Text</span>
```

4. **Check if it's a Bootstrap/asset issue.** Odoo 18 changed how report assets are bundled. Make sure your report template inherits from the correct base layout. In your report action, verify:
```xml
<field name="paperformat_id" ref="base.paperformat_euro"/>
```
And in your template, ensure you're extending:
```xml
<t t-call="web.html_container">
    <t t-call="web.external_layout">
```

5. **Restart wkhtmltopdf or check version.** Odoo 18 works best with wkhtmltopdf `0.12.6.1` with patched Qt. Run `wkhtmltopdf --version` to confirm.

If none of these work, share your QWeb template snippet — the issue might be CSS specificity where another rule is overriding `font-weight` to `normal`.

0
Avatar
Discard
Avatar
Sangar
Best Answer

Hi Ashilkrishna 👋,

In Odoo PDF reports, <strong> often doesn’t work because wkhtmltopdf ignores certain HTML tags. The recommended way is to use inline CSS or a CSS class with font-weight: bold. For example:


<td style="font-weight:bold;">
<t t-esc="o.ref"/> - <t t-esc="o.name"/>
</td>

<td class="text-end">
<span style="font-weight:bold;">
<t t-esc="sum_partner(data, o, 'debit')" t-options="{'widget':'monetary','display_currency':res_company.currency_id}"/>
</span>
</td>

Wrap monetary widgets in a span and use !important if needed. This ensures headers and totals appear bold in PDFs.

Hope this helps and solves your issue!

0
Avatar
Discard
Avatar
Savya Sachin
Best Answer
Hi

It’s always recommended to use the class-based approach if it exists.

fw-bold is the standard Bootstrap 5 class for font-weight: bold

<td class="text-end fw-bold">
    <span t-esc="sum_partner(data, o, 'debit')"
          t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>

</td>

Thanks

0
Avatar
Discard
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
PDF reports Solved
pdf report
Avatar
Avatar
Avatar
Avatar
Avatar
5
Jul 25
5056
Wrong PDF Format Solved
pdf report
Avatar
Avatar
Avatar
2
Mar 24
5692
Printing report error: _get_rendering_context() take 3 posisional arguments but 4 were given
pdf report
Avatar
0
Nov 22
5112
Default to HTML reports
pdf report
Avatar
0
Sep 17
7620
strange report file generated instead of pdf
pdf report
Avatar
0
Mar 15
5559
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk Slovenščina Español (América Latina) Español Svenska ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now