mirror of
https://github.com/OCA/reporting-engine.git
synced 2025-02-16 16:30:38 +02:00
115 lines
4.7 KiB
ReStructuredText
115 lines
4.7 KiB
ReStructuredText
=========================
|
|
Report Qweb Decimal Place
|
|
=========================
|
|
|
|
..
|
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
!! This file is generated by oca-gen-addon-readme !!
|
|
!! changes will be overwritten. !!
|
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
!! source digest: sha256:9eb9842a63d5d4d8e1e57806d1cb69cc868f05a50a7f173bd25f2cb549c0a93e
|
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
|
:target: https://odoo-community.org/page/development-status
|
|
:alt: Beta
|
|
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
|
|
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
|
|
:alt: License: LGPL-3
|
|
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github
|
|
:target: https://github.com/OCA/reporting-engine/tree/16.0/report_qweb_decimal_place
|
|
:alt: OCA/reporting-engine
|
|
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
|
:target: https://translation.odoo-community.org/projects/reporting-engine-16-0/reporting-engine-16-0-report_qweb_decimal_place
|
|
:alt: Translate me on Weblate
|
|
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
|
|
:target: https://runboat.odoo-community.org/builds?repo=OCA/reporting-engine&target_branch=16.0
|
|
:alt: Try me on Runboat
|
|
|
|
|badge1| |badge2| |badge3| |badge4| |badge5|
|
|
|
|
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:
|
|
|
|
.. code-block:: xml
|
|
|
|
<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**
|
|
|
|
.. contents::
|
|
:local:
|
|
|
|
Configuration
|
|
=============
|
|
|
|
To apply price unit format:
|
|
|
|
#. Go to Invoicing --> Configuration --> Currencies
|
|
#. Check apply_price_decimal_place field
|
|
#. 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 <https://github.com/OCA/reporting-engine/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 <https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_qweb_decimal_place%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
|
|
|
Do not contact contributors directly about support or help with technical issues.
|
|
|
|
Credits
|
|
=======
|
|
|
|
Authors
|
|
~~~~~~~
|
|
|
|
* Quartile Limited
|
|
|
|
Maintainers
|
|
~~~~~~~~~~~
|
|
|
|
This module is maintained by the OCA.
|
|
|
|
.. image:: https://odoo-community.org/logo.png
|
|
:alt: Odoo Community Association
|
|
:target: https://odoo-community.org
|
|
|
|
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 <https://github.com/OCA/reporting-engine/tree/16.0/report_qweb_decimal_place>`_ project on GitHub.
|
|
|
|
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|