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
    • Approvals
    • 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
    • Estate 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

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
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

How to hide units of measure in PDF reports?

Subscribe

Get notified when there's activity on this post

This question has been flagged
salesdebugpdf
3 Replies
598 Views
Avatar
Lorena

I am new to Odoo, and working with 19 version.

I need to hide "Units" from the quantity column.

I tried making invisible the field over:

<field name="product_uom_id" groups="uom.group_uom" widget="many2one_uom" invisible="1"/> on sale.order.line.list 

<field name="product_uom_id" force_save="1" groups="uom.group_uom" widget="many2one_uom" readonly="product_uom_readonly" required="not display_type" invisible="1"/> on  sale.order.line.form.readonly


<span t-field="line.product_uom_id" invisible="1">units</span> on  report_saleorder_document 

Is there another viw that I am missing? Or is my xml coding incorrect?

0
Avatar
Discard
Codesphere Tech

Hello,
Specify the report name where you want to hide UOM.

Codesphere Tech

Hello,
Below is the line I found on the report_saleorder_document in Odoo 18..
<span t-field="line.product_uom">units</span>
Inherit the template and remove this line or hide..

Codesphere Tech

Hello, Lorena
invisible attributes works only in field level not in tags and if you have already inherited that template just replace the position with blank or remove the code.

Avatar
Jainesh Shah(Aktiv Software)
Best Answer

Hello Lorena,

 

If you want to hide the “Units of Measure” from the PDF report (for example, in the Sale Order report), you can do this easily by inheriting the specific QWeb report template and applying the d-none class using XPath with the position="attributes" directive.

 

Steps to Hide UoM in PDF Report

 

Inherit the report template and use XPath to add the Bootstrap d-none class to the UoM field.

 

Example Code:

<odoo>

<!-- Inherit the Sale Order PDF report -->

<template id="report_saleorder_document_inherit_hide_uom" inherit_id="sale.report_saleorder_document">


<!-- Hide only the UoM text (the span field) -->

<xpath expr="//span[@t-field='line.product_uom']" position="attributes">

<attribute name="class">d-none</attribute>

</xpath>

        </template>

</odoo>

 

If you have any questions, feel free to reach out.


Hope this helps!


Thanks & Regards,

Email : odoo@aktivsoftware.com

0
Avatar
Discard
Avatar
Lorena
Author Best Answer

Codesphere Tech: I want to hide Units (not quantity) from quotation PDF reports.

0
Avatar
Discard
Lorena
Author

Codesphere Tech: Hello Lakhan Vachhani!

I deleted the line and the magic happenned!! Thank you!!

Avatar
Cybrosys Techno Solutions Pvt.Ltd
Best Answer

Hi,


Try the following code,


1- Sale order line.


Override the tree view for sale.order.line and remove the UoM widget from the product_uom_qty field. Example:


<record id="view_order_line_tree_no_uom" model="ir.ui.view">

    <field name="name">sale.order.line.tree.no.uom</field>

    <field name="model">sale.order.line</field>

    <field name="inherit_id" ref="sale.view_order_line_tree"/>

    <field name="arch" type="xml">

        <xpath expr="//field[@name='product_uom_qty']" position="replace">

            <field name="product_uom_qty"/>

        </xpath>

    </field>

</record>


2- PDF report.


Simply remove or comment out the product_uom_id span, or replace it with just the quantity field:


<span t-field="line.product_uom_qty"/>


Hope it helps

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
How to keep footer always at the bottom of the very last page in QWeb PDF report
sales debug pdf
Avatar
Avatar
Avatar
2
Aug 25
1279
adding custom field in quotation/invoice
sales pdf
Avatar
Avatar
1
Nov 25
429
Customizing the Quotation PDF: How to add a customer contact person on PDF sales order? Odoo 18.3
debug pdf
Avatar
Avatar
Avatar
3
Sep 25
906
Odoo 18 Quotation Builder Header/Footer Print Problem Solved
sales pdf
Avatar
Avatar
2
Aug 25
4484
Digital products
sales pdf
Avatar
Avatar
1
Feb 25
8057
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 ภาษาไทย 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