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

How to use <span t-esc=""> into xpath?

Suscribirse

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

Se marcó esta pregunta
inheritxpathspan
2 Respuestas
9428 Vistas
Avatar
Chints

I have span tag which contain a method define in parser now I want to add additional parameter and used in inherit xml template How can I so existing methods get replaced with new, Below is my xml code for main model:

<?xml version="1.0" encoding="UTF-8" ?>

<odoo>
<template id="report_team_wizard_multi">
<t t-call="web.html_container">
<t t-call="web.external_layout">
<center>
<h3>Pay Slip</h3>
</center>
<t t-foreach="docs" t-as="emp">
<strong>Date:</strong>
<sapn t-esc="data['form']['date']"/> <!--fields used from wizard must be like this-->
<br/>
<strong class="text-uppercase">Name:</strong>
<span t-field="emp.name"/>
<br/>
<strong class="text-uppercase">Email:</strong>
<span t-field="emp.email"/>
<br/>
<strong class="text-uppercase">Department:</strong>
<span t-field="emp.comp_name"/>
<br/>
<strong class="text-uppercase">Contact Number:</strong>
<span t-field="emp.phone"/> <!--TODO 8.8 print information from model-->
<br/>
<strong class="text-uppercase">Reporting To:</strong>
<span t-field="emp.parent_id"/>
<br/>
<br/>
<table width="100%" class="table-primary">
<thead>
<th>Month</th>
<th>Basic</th>
<th>Allowance</th>
<th>Deduction</th>
</thead>
<t t-foreach="emp.salary_ids" t-as="sal">
<tr>
<td>
<span t-field="sal.month"/>
</td>
<td>
<span t-field="sal.basic"/>
</td>
<td class="text-success">
<span t-field="sal.allowance"/>
</td>
<td class="text-danger">
<span t-field="sal.deduction"/>
</td>
</tr>
</t>
</table>
<br/>
<br/>
<td>
<b>Total Gross:</b>
</td>
<span t-esc="get_total_gross(emp.salary_ids)"/>
<br/>
<td>
<b>House Rent Allowance:</b>
</td>
<span t-esc="data['form']['house_rent_allowance']"/> <!--TODO 8.8 wizard's field-->
<br/>
<td>
<b>CTC:</b>
</td>
<span t-esc="get_ctc(emp.salary_ids, data['form']['house_rent_allowance'])"/>
<br/>
<br/>
<br/>
<br/>
<b>
<h3>
<span t-esc="sign"/>
</h3>
</b>
<br/>
<br/>
<center>
<h8>
<b>NOTE:</b>
Benefit for all employee will be 10000, Total Gross + Benefits + House Rent Allowance = CTC
</h8>
</center>
</t>
</t>
</t>
</template>
</odoo>

And Here my inherit xml:


<?xml version="1.0" encoding="UTF-8" ?>

<!-- TODO: 8.18 -->
<odoo>
<template id="report_team_wizard_multi_inherit" inherit_id="workshop_aftersales.report_team_wizard_multi">
<xpath expr="//span[@t-field='emp.parent_id']" position="after">
<br/>
<br/>
<strong>Medical Insurance:</strong>
<span t-esc="data['form']['med_insure']"/>
</xpath>

<xpath expr="//span[@t-esc='get_ctc(emp.salary_ids, data['form']['house_rent_allowance'])']" position="replace">
<!-- <xpath expr="//a[@name='ctc']" position="before">-->
<span t-esc="get_ctc(emp.salary_ids, data['form']['house_rent_allowance'], data['form']['med_insure'])"/>
</xpath>

</template>
</odoo>

This gave me error, lxml.etree.XPathSyntaxError: Invalid predicate

Thank you.

0
Avatar
Descartar
Avatar
Jérémy Kersten (jke)
Mejor respuesta

The error message is because this xpath is wrong:

//span[@t-esc='get_ctc(emp.salary_ids, data['form']['house_rent_allowance'])'

you have ' in ', nothing related with

 <span t-esc/>
0
Avatar
Descartar
Avatar
Chints
Autor Mejor respuesta

Hey there, thanks but I've figured it out. Thanks anyway!!

-1
Avatar
Descartar
Gabin

Hey, i have a similary error, hat solution did you find ?

¿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
Is it possible to use xpath in a qweb template WITHOUT to inherit an other template? Resuelto
inherit xpath
Avatar
Avatar
1
sept 15
5648
odoo 15 to odoo 16 error while upgrading the app
inherit xpath odoo
Avatar
Avatar
Avatar
2
mar 24
2536
Problem XML View Architecture
view inherit xpath
Avatar
Avatar
Avatar
3
mar 15
7742
How to modify child_ids form fields by inheriting contact page
views inherit xpath
Avatar
1
mar 15
6146
[SOLVED] customisasi/inherit xpath widget hr_leave_stats in hr.holidays (Time Off)
holidays inherit xpath timeoff
Avatar
Avatar
1
may 24
2745
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