Ir al contenido
Odoo Menú
  • Iniciar sesión
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • PdV para tiendas
    • PdV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en vivo
    • eLearning
    Cadena de suministro
    • Inventario
    • Manufactura
    • PLM
    • Compras
    • Mantenimiento
    • Calidad
    Recursos humanos
    • Empleados
    • Reclutamiento
    • Vacaciones
    • Evaluaciones
    • Referencias
    • Flotilla
    Marketing
    • Redes sociales
    • Marketing por correo
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyectos
    • Registro de horas
    • Servicio externo
    • Soporte al cliente
    • Planeación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Artículos
    • WhatsApp
    Aplicaciones externas Studio de Odoo Plataforma de Odoo en la nube
  • Industrias
    Venta minorista
    • Librería
    • Tienda de ropa
    • Mueblería
    • Tienda de abarrotes
    • Ferretería
    • Juguetería
    Alimentos y hospitalidad
    • Bar y pub
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidora de bebidas
    • Hotel
    Bienes inmuebles
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión de bienes inmuebles
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Firma contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Manufactura
    • Textil
    • Metal
    • Muebles
    • Comida
    • Cervecería
    • Regalos corporativos
    Salud y ejercicio
    • Club deportivo
    • Óptica
    • Gimnasio
    • Especialistas en bienestar
    • Farmacia
    • Peluquería
    Trades
    • Personal de mantenimiento
    • Hardware y soporte de TI
    • Sistemas de energía solar
    • Zapateros y fabricantes de calzado
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin fines de lucro
    • Agencia para la protección del medio ambiente
    • Alquiler de anuncios publicitarios
    • Fotografía
    • Alquiler de bicicletas
    • Distribuidor de software
    Descubre todas las industrias
  • Odoo Community
    Aprende
    • Tutoriales
    • Documentación
    • Certificaciones
    • Capacitación
    • Blog
    • Podcast
    Fortalece la educación
    • Programa educativo
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtén el software
    • Descargar
    • Compara ediciones
    • Versiones
    Colabora
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Conviértete en partner
    • Servicios para partners
    • Registra tu firma contable
    Obtén servicios
    • Encuentra un partner
    • Encuentra un contador
    • Contacta a un consultor
    • Servicios de implementación
    • Referencias de clientes
    • Soporte
    • Actualizaciones
    GitHub YouTube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicita 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
  • Proyectos
  • 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
8925 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.

Registrarse
Publicaciones relacionadas Respuestas Vistas Actividad
Monetary widget on odoo 11.0 currency wont show
widget monetary odoo11.0
Avatar
Avatar
2
feb 24
8984
How to show a symbol inside a field like with the monetary widget? Resuelto
widget field monetary
Avatar
Avatar
1
may 17
5277
Monetary widget within form
form widget monetary
Avatar
Avatar
1
feb 24
34660
Simply adding currency symbol to form?
form widget currency monetary
Avatar
Avatar
1
mar 15
10045
[Odoo 16] Date widget validates the type of maxDate is wrong
widget
Avatar
Avatar
1
jul 24
2999
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento en Odoo.sh
  • Soporte
  • Actualizaciones del software
  • Desarrollos personalizados
  • Educación
  • Encuentra un contador
  • Encuentra un partner
  • Conviértete en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contáctanos
  • Empleos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • 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 estar 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