Ir al contenido
Odoo Menú
  • Identificarse
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • TPV para tiendas
    • TPV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en directo
    • eLearning
    Cadena de suministro
    • Inventario
    • Fabricación
    • PLM
    • Compra
    • Mantenimiento
    • Calidad
    Recursos Humanos
    • Empleados
    • Reclutamiento
    • Ausencias
    • Evaluación
    • Referencias
    • Flota
    Marketing
    • Marketing social
    • Marketing por correo electrónico
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyecto
    • Partes de horas
    • Servicio de campo
    • Servicio de asistencia
    • Planificación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Información
    • WhatsApp
    Aplicaciones de terceros Studio de Odoo Plataforma de Odoo Cloud
  • Industrias
    Comercio al por menor
    • Librería
    • Tienda de ropa
    • Tienda de muebles
    • Tienda de ultramarinos
    • Ferretería
    • Juguetería
    Alimentación y hostelería
    • Bar y taberna
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidor de bebidas
    • Hotel
    Inmueble
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión inmobiliaria
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Empresa contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Fabricación
    • Textil
    • Metal
    • Muebles
    • Alimentos
    • Brewery
    • Regalos de empresas
    Salud y bienestar
    • Club deportivo
    • Óptica
    • Gimnasio
    • Terapeutas
    • Farmacia
    • Peluquería
    Oficios
    • Handyman
    • Hardware y asistencia informática
    • Sistemas de energía solar
    • Zapatero
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin ánimo de lucro
    • Agencia de protección del medio ambiente
    • Alquiler de paneles publicitarios
    • Estudio fotográfico
    • Alquiler de bicicletas
    • Distribuidor de software
    Browse all Industries
  • Comunidad
    Aprender
    • Tutoriales
    • Documentación
    • Certificaciones
    • Formación
    • Blog
    • Podcast
    Potenciar la educación
    • Programa de formación
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtener el software
    • Descargar
    • Comparar ediciones
    • Versiones
    Colaborar
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Convertirse en partner
    • Services for Partners
    • Registrar tu empresa contable
    Obtener servicios
    • Encontrar un partner
    • Encontrar un asesor fiscal
    • Contacta con un experto
    • Servicios de implementación
    • Referencias de clientes
    • Ayuda
    • Actualizaciones
    GitHub YouTube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicitar una demostración
  • Precios
  • Ayuda

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

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyecto
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

Monetary widget and localization

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
widgetlocalizationmonetary
8921 Vistas
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
Descartar
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.

¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Inscribirse
Publicaciones relacionadas Respuestas Vistas Actividad
Monetary widget on odoo 11.0 currency wont show
widget monetary odoo11.0
Avatar
Avatar
2
feb 24
8978
How to show a symbol inside a field like with the monetary widget? Resuelto
widget field monetary
Avatar
Avatar
1
may 17
5276
Monetary widget within form
form widget monetary
Avatar
Avatar
1
feb 24
34657
Simply adding currency symbol to form?
form widget currency monetary
Avatar
Avatar
1
mar 15
10042
[Odoo 16] Date widget validates the type of maxDate is wrong
widget
Avatar
Avatar
1
jul 24
2998
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento Odoo.sh
  • Ayuda
  • Actualizar
  • Desarrollos personalizados
  • Educación
  • Encontrar un asesor fiscal
  • Encontrar un partner
  • Convertirse en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contacta con nosotros
  • Puestos de trabajo
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Información legal • Privacidad
  • Seguridad
الْعَرَبيّة 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 es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y totalmente integrado.

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