Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Schvalování
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Jídlo a pohostinství
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Penzion
    • Distributor nápojů
    • Hotel
    Nemovitost
    • Realitní kancelář
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Poradenství
    • Účetní firma
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textile
    • Kov
    • Nábytek
    • Jídlo
    • Brewery
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Transakce
    • Údržbář
    • IT hardware a podpora
    • Systémy solární energie
    • Výrobce obuvi
    • Úklidové služby
    • Služby HVAC
    Ostatní
    • Nezisková organizace
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Browse all Industries
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Services for Partners
    • Registrujte svou účetní firmu
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účetnictví
  • Sklad
  • PoS
  • Projekty
  • MRP
All apps
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
Pomoc

Monetary widget and localization

Odebírat

Get notified when there's activity on this post

This question has been flagged
widgetlocalizationmonetary
8924 Zobrazení
Avatar
Maxime MARAIS

Hi all,

I'm modifying the report_invoice_document template by inheriting it and i'm facing weird localization issues. In the same xpath block, for a French customer, I get both amounts localized in English and in French. For example, the following xpath node produces the result bellow.

<template id="report_invoice_layouted" inherit_id="export_invoice.report_invoice_document">
            <!-- Grand total -->
            <xpath expr="//div[@id='tax_summary']" position="after">
                <t t-set="tax_amount" t-value="sum(tax.amount for tax in o.tax_line_ids)"/>
                <t t-if="tax_amount > 0">
                    <div class="row" id="invoice_total_dynamic">
                        <div class="col-xs-12">
                            <table class="table table-condensed">
                                <thead>
                                    <tr class="active">
                                        <th colspan="2">Grand total</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr class="border-black">
                                        <td>Subtotal</td>
                                        <td class="text-right">
                                            <span t-field="o.amount_untaxed"
                                                  t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
                                        </td>
                                    </tr>
                                    <t t-foreach="o._get_tax_amount_by_group()" t-as="amount_by_group">
                                        <tr>
                                            <td>
                                                <span t-esc="amount_by_group[0] if len(o.tax_line_ids) > 1 else (o.tax_line_ids.tax_id.description or o.tax_line_ids.tax_id.name)"/>
                                            </td>
                                            <td class="text-right">
                                                <span t-esc="amount_by_group[1]"
                                                      t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
                                            </td>
                                        </tr>
                                    </t>
                                </tbody>
                                <tfoot>
                                    <tr>
                                        <th>TOTAL INCLUDING TAXES</th>
                                        <th class="text-right">
                                            <span t-field="o.amount_total"
                                                  t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
                                        </th>
                                    </tr>
                                </tfoot>
                            </table>
                        </div>
                    </div>
                </t>
            </xpath>
</template>

Result: 

Grand total

Subtotal
 6 750,00 €
20.0
1,350.00 €
TOTAL INCLUDING TAXES
8 100,00 €

The same span in the same xpath block

<span t-field="XXXX" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>

displays numbers formatted either 8 888,88 € (French - thousand separator: space, decimal separator: comma or 8,888.88 € (English - thousand separator: comma, decimal separator: dot).

Any clue how to fix this?

Thanks.

0
Avatar
Zrušit
Maxime MARAIS
Autor

It seems the issue is due to the way these model properties are computed :

amount_untaxed and amount_total are results of the sum() function whereas amount_by_group[1] is the result of subsequent additions.

./account/models/account_invoice.py:1145-1154 :

res[line.tax_id.tax_group_id] += line.amount

In the first case, the current user language is used.

In the second case, the t-lang="o.partner_id.lang" attribut as defined in <t t-call> tag is used.

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

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

Přihlásit se
Related Posts Odpovědi Zobrazení Aktivita
Monetary widget on odoo 11.0 currency wont show
widget monetary odoo11.0
Avatar
Avatar
2
úno 24
8980
How to show a symbol inside a field like with the monetary widget? Vyřešeno
widget field monetary
Avatar
Avatar
1
kvě 17
5277
Monetary widget within form
form widget monetary
Avatar
Avatar
1
úno 24
34658
Simply adding currency symbol to form?
form widget currency monetary
Avatar
Avatar
1
bře 15
10044
[Odoo 16] Date widget validates the type of maxDate is wrong
widget
Avatar
Avatar
1
čvc 24
2998
Komunita
  • Tutoriály
  • Dokumentace
  • Fórum
Open Source
  • Stáhnout
  • Github
  • Runbot
  • Překlady
Služby
  • Odoo.sh hostování
  • Podpora
  • Upgrade
  • Nestandardní vývoj
  • Edukační program
  • Najít účetní
  • Najít partnera
  • Stát se partnerem
O nás
  • Naše společnost
  • Podklady značky
  • Kontakujte nás
  • Práce
  • Události
  • Podcast
  • Blog
  • Zákazníci
  • Právní dokumenty • Soukromí
  • Zabezpečení
الْعَرَبيّة 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 je balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

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