Skip to main content

Report Qweb Decimal Place

Beta License: LGPL-3 OCA/reporting-engine Translate me on Weblate Try me on Runboat

This module intends to provide the base function for currencies to adjust the number of decimal places for the unit price in QWeb reports. Installing this module alone does not affect the presentation of existing QWeb reports. Individual adjustments need to be done in separate modules in a manner similar to the following:

<template
    id="report_saleorder_document_inherit"
    inherit_id="sale.report_saleorder_document"
>
    <xpath expr="//span[@t-field='line.price_unit']" position="attributes">
        <attribute
            name="t-att-style"
        >'display: none' if doc.currency_id.apply_price_decimal_place else ''</attribute>
    </xpath>
    <xpath expr="//span[@t-field='line.price_unit']" position="after">
        <t t-set="currency" t-value="doc.currency_id" />
        <t t-set="price_unit" t-value="line.price_unit" />
        <t t-call="report_qweb_decimal_place.price_unit_value_format" />
    </xpath>
</template>

Background:

Odoo default reports display price unit with the decimal accuracy of product price configuration. However, globally applying the decimal accuracy setting is sometimes not appropriate under multi-currency settings where how unit prices should be presented differs depending on the currency.

For example, unit prices in JPY usually do not have decimals (with some exceptions depending on the industry), while those in USD may require up to 2-4 decimals. If we configure the decimal accuracy based on USD, the unit price presentation on PDF reports for JPY transactions may appear a bit unconventional.

Table of contents

Configuration

To apply price unit format:

  1. Go to Invoicing –> Configuration –> Currencies

  2. Check apply_price_decimal_place field

  3. Define decimal place in price_decimal_place field

Inherit this module in your xxx_report_qweb_decimal_place module and format the price unit in reports.

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.

Do not contact contributors directly about support or help with technical issues.

Credits

Authors

  • Quartile Limited

Maintainers

This module is maintained by the OCA.

Odoo Community Association

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

This module is part of the OCA/reporting-engine project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

Release files for odoo-addon-report-qweb-decimal-place 16.0.1.0.0.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for odoo-addon-report-qweb-decimal-place 16.0.1.0.0.10
File Interpreter ABI Platform
odoo_addon_report_qweb_decimal_place-16.0.1.0.0.10-py3-none-any.whl Python 3 none any Details

Release files / odoo_addon_report_qweb_decimal_place-16.0.1.0.0.10-py3-none-any.whl

Download URL odoo_addon_report_qweb_decimal_place-16.0.1.0.0.10-py3-none-any.whl
Size 27.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e4637976e80d01dfd3b94d8baf9642f7bf6980bb16c98ae549dd1636b42a2c9f
BLAKE2b-256 checksum
How to use checksums
547fec7249acd9775f1843fdbfda4441aa8425c8fafb77df915729464e6d47ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page