@@ -367,15 +367,40 @@ <h1 class="title">Report Qweb Decimal Place</h1>
367367!! This file is generated by oca-gen-addon-readme !!
368368!! changes will be overwritten. !!
369369!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
370- < p > < a class ="reference external " href ="https://odoo-community.org/page/development-status "> < img alt ="Beta " src ="https://img.shields.io/badge/maturity-Beta-yellow.png " /> </ a > < a class ="reference external " href ="http://www.gnu.org/licenses/agpl-3.0-standalone.html "> < img alt ="License: AGPL-3 " src ="https://img.shields.io/badge/licence-AGPL--3-blue.png " /> </ a > < a class ="reference external " href ="https://github.com/OCA/reporting-engine/tree/15.0/report_qweb_decimal_place "> < img alt ="OCA/reporting-engine " src ="https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github " /> </ a > < a class ="reference external " href ="https://translation.odoo-community.org/projects/reporting-engine-15-0/reporting-engine-15-0-report_qweb_decimal_place "> < img alt ="Translate me on Weblate " src ="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png " /> </ a > < a class ="reference external " href ="https://runbot.odoo-community.org/runbot/143/15.0 "> < img alt ="Try me on Runbot " src ="https://img.shields.io/badge/runbot-Try%20me-875A7B.png " /> </ a > </ p >
371- < p > This module does the following:</ p >
372- < ul class ="simple ">
373- < li > Adds apply_price_unit_format in currency and the price_unit format of reports will depend on that field.</ li >
374- </ ul >
370+ < p > < a class ="reference external " href ="https://odoo-community.org/page/development-status "> < img alt ="Beta " src ="https://img.shields.io/badge/maturity-Beta-yellow.png " /> </ a > < a class ="reference external " href ="http://www.gnu.org/licenses/lgpl-3.0-standalone.html "> < img alt ="License: LGPL-3 " src ="https://img.shields.io/badge/licence-LGPL--3-blue.png " /> </ a > < a class ="reference external " href ="https://github.com/OCA/reporting-engine/tree/15.0/report_qweb_decimal_place "> < img alt ="OCA/reporting-engine " src ="https://img.shields.io/badge/github-OCA%2Freporting--engine-lightgray.png?logo=github " /> </ a > < a class ="reference external " href ="https://translation.odoo-community.org/projects/reporting-engine-15-0/reporting-engine-15-0-report_qweb_decimal_place "> < img alt ="Translate me on Weblate " src ="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png " /> </ a > < a class ="reference external " href ="https://runbot.odoo-community.org/runbot/143/15.0 "> < img alt ="Try me on Runbot " src ="https://img.shields.io/badge/runbot-Try%20me-875A7B.png " /> </ a > </ p >
371+ < p > This module intends to provide the base function for currencies to adjust the number of decimal places
372+ for the unit price in QWeb reports.
373+ Installing this module alone does not affect the presentation of existing QWeb reports.
374+ Individual adjustments need to be done in separate modules in a manner similar to the following:</ p >
375+ < pre class ="code xml literal-block ">
376+ < span class ="cp "> <?xml version="1.0" encoding="utf-8" ?></ span >
377+ < span class ="nt "> <odoo></ span >
378+ < span class ="nt "> <template</ span >
379+ < span class ="na "> id=</ span > < span class ="s "> "report_saleorder_document_inherit"</ span >
380+ < span class ="na "> inherit_id=</ span > < span class ="s "> "sale.report_saleorder_document"</ span >
381+ < span class ="nt "> ></ span >
382+ < span class ="nt "> <xpath</ span > < span class ="na "> expr=</ span > < span class ="s "> "//tbody[@class='sale_tbody']//tr//td[3]"</ span > < span class ="na "> position=</ span > < span class ="s "> "replace"</ span > < span class ="nt "> ></ span >
383+ < span class ="nt "> <td</ span > < span class ="na "> name=</ span > < span class ="s "> "td_priceunit"</ span > < span class ="na "> class=</ span > < span class ="s "> "text-right"</ span > < span class ="nt "> ></ span >
384+ < span class ="nt "> <t</ span > < span class ="na "> t-set=</ span > < span class ="s "> "currency"</ span > < span class ="na "> t-value=</ span > < span class ="s "> "doc.currency_id"</ span > < span class ="nt "> /></ span >
385+ < span class ="nt "> <t</ span > < span class ="na "> t-set=</ span > < span class ="s "> "price_unit"</ span > < span class ="na "> t-value=</ span > < span class ="s "> "line.price_unit"</ span > < span class ="nt "> /></ span >
386+ < span class ="nt "> <t</ span > < span class ="na "> t-call=</ span > < span class ="s "> "report_qweb_decimal_place.price_unit_value_format"</ span > < span class ="nt "> /></ span >
387+ < span class ="nt "> </td></ span >
388+ < span class ="nt "> </xpath></ span >
389+ < span class ="nt "> </template></ span >
390+ < span class ="nt "> </odoo></ span >
391+ </ pre >
392+ < div class ="section " id ="background ">
393+ < h1 > Background:</ h1 >
394+ < p > Odoo default reports display price unit with the decimal accuracy of product price configuration.
395+ However, globally applying the decimal accuracy setting is sometimes not appropriate under multi-currency settings
396+ where how unit prices should be presented differs depending on the currency.</ p >
397+ < p > For example, unit prices in JPY usually do not have decimals (with some exceptions depending on the industry),
398+ while those in USD may require up to 2-4 decimals. If we configure the decimal accuracy based on USD, the unit price
399+ presentation on PDF reports for JPY transactions may appear a bit unconventional.</ p >
375400< p > < strong > Table of contents</ strong > </ p >
376401< div class ="contents local topic " id ="contents ">
377402< ul class ="simple ">
378- < li > < a class ="reference internal " href ="#usage " id ="id1 "> Usage </ a > </ li >
403+ < li > < a class ="reference internal " href ="#configuration " id ="id1 "> Configuration </ a > </ li >
379404< li > < a class ="reference internal " href ="#bug-tracker " id ="id2 "> Bug Tracker</ a > </ li >
380405< li > < a class ="reference internal " href ="#credits " id ="id3 "> Credits</ a > < ul >
381406< li > < a class ="reference internal " href ="#authors " id ="id4 "> Authors</ a > </ li >
@@ -384,36 +409,37 @@ <h1 class="title">Report Qweb Decimal Place</h1>
384409</ li >
385410</ ul >
386411</ div >
387- < div class ="section " id ="usage ">
388- < h1 > < a class ="toc-backref " href ="#id1 "> Usage </ a > </ h1 >
412+ < div class ="section " id ="configuration ">
413+ < h2 > < a class ="toc-backref " href ="#id1 "> Configuration </ a > </ h2 >
389414< dl class ="docutils ">
390415< dt > To apply price unit format:</ dt >
391416< dd > < ul class ="first last simple ">
392417< li > Go to Invoicing –> Configuration –> Currencies</ li >
393- < li > Check apply_price_unit_format field</ li >
418+ < li > Check apply_price_decimal_place field</ li >
419+ < li > Define decimal place in price_decimal_place field</ li >
394420</ ul >
395421</ dd >
396422</ dl >
397423< p > Inherit this module in your xxx_report_qweb_decimal_place module and format the price unit in reports.</ p >
398424</ div >
399425< div class ="section " id ="bug-tracker ">
400- < h1 > < a class ="toc-backref " href ="#id2 "> Bug Tracker</ a > </ h1 >
426+ < h2 > < a class ="toc-backref " href ="#id2 "> Bug Tracker</ a > </ h2 >
401427< p > Bugs are tracked on < a class ="reference external " href ="https://github.com/OCA/reporting-engine/issues "> GitHub Issues</ a > .
402428In case of trouble, please check there if your issue has already been reported.
403429If you spotted it first, help us smashing it by providing a detailed and welcomed
404430< a class ="reference external " href ="https://github.com/OCA/reporting-engine/issues/new?body=module:%20report_qweb_decimal_place%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior** "> feedback</ a > .</ p >
405431< p > Do not contact contributors directly about support or help with technical issues.</ p >
406432</ div >
407433< div class ="section " id ="credits ">
408- < h1 > < a class ="toc-backref " href ="#id3 "> Credits</ a > </ h1 >
434+ < h2 > < a class ="toc-backref " href ="#id3 "> Credits</ a > </ h2 >
409435< div class ="section " id ="authors ">
410- < h2 > < a class ="toc-backref " href ="#id4 "> Authors</ a > </ h2 >
436+ < h3 > < a class ="toc-backref " href ="#id4 "> Authors</ a > </ h3 >
411437< ul class ="simple ">
412438< li > Quartile Limited</ li >
413439</ ul >
414440</ div >
415441< div class ="section " id ="maintainers ">
416- < h2 > < a class ="toc-backref " href ="#id5 "> Maintainers</ a > </ h2 >
442+ < h3 > < a class ="toc-backref " href ="#id5 "> Maintainers</ a > </ h3 >
417443< p > This module is maintained by the OCA.</ p >
418444< a class ="reference external image-reference " href ="https://odoo-community.org "> < img alt ="Odoo Community Association " src ="https://odoo-community.org/logo.png " /> </ a >
419445< p > OCA, or the Odoo Community Association, is a nonprofit organization whose
@@ -424,5 +450,6 @@ <h2><a class="toc-backref" href="#id5">Maintainers</a></h2>
424450</ div >
425451</ div >
426452</ div >
453+ </ div >
427454</ body >
428455</ html >
0 commit comments