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

Element cannot be located in parent view ERROR. vOdoo17

Suscribirse

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

Se marcó esta pregunta
xmlerrorsxml_idelementsodoo17
2 Respuestas
1362 Vistas
Avatar
Elijah Nyendwa

Hello, i am trying to create a custom customer statement template in odoo17 but i keep getting this error in the terminal that doesn't quite make sense, i have reviewed my code, given it to AI and still nothing but the same error:



odoo.tools.convert.ParseError: while parsing None:4

Error while parsing or validating view:


Element '<t t-name="zra_smart_invoice.report_customer_statement_aged">' cannot be located in parent view


View error context:

{'file': 'c:\\program '

'files\\odoo17\\odoo17-dev\\custom\\zra_smart_invoice\\report\\report_customer_statement_aged.xml',

'line': 2,

'name': 'report_customer_statement_aged',

'view': ir.ui.view(2191,),

'view.model': False,

'view.parent': ir.ui.view(2089,),

'xmlid': 'report_customer_statement_aged'}


I don't know if this forum deals with coding in odoo but i really just need help


here is the custom XML code


        <!-- Customer Statement Report -->
   <record id="action_print_customer_statement_aged" model="ir.actions.report">
    <field name="name">Print Aged Statement</field>
    <field name="model">res.partner</field>
    <field name="report_type">qweb-pdf</field>
    <field name="report_name">zra_smart_invoice.report_customer_statement_aged</field>
    <field name="report_file">zra_smart_invoice.report_customer_statement_aged</field>
    <field name="print_report_name">'Statement - %s' % (object.name)</field>
    <field name="binding_model_id" ref="model_res_partner"/>
    <field name="binding_type">report</field>
</record>


<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <!-- Main report template (MUST be this exact structure) -->
    <template id="report_customer_statement_aged">
    <t t-name="zra_smart_invoice.report_customer_statement_aged">
        <t t-call="zra_smart_invoice.external_layout">
            <t t-foreach="docs" t-as="doc">
             
                    <div class="page">
                        <!-- Header Section -->
                        <div class="header" style="margin-bottom: 20px;">
                            <h1 style="text-align: center;">CUSTOMER STATEMENT</h1>
                            <div style="text-align: center;">
                                <span t-out="context.get('date_from')"/> to <span t-out="context.get('date_to')"/>
                            </div>
                        </div>

                        <!-- Customer Info -->
                        <div style="margin-bottom: 30px;">
                            <address t-field="doc" t-options="{'widget': 'contact', 'fields': ['address', 'name', 'vat'], 'no_marker': True}"/>
                        </div>

                        <!-- Transactions Table -->
                        <t t-set="statement_lines" t-value="doc._get_statement_lines()"/>
                        <table class="table table-bordered" style="width: 100%;">
                            <thead>
                                <tr>
                                    <th>Date</th>
                                    <th>Description</th>
                                    <th>Due Date</th>
                                    <th class="text-end">Amount</th>
                                    <th class="text-end">Balance</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr t-foreach="statement_lines" t-as="line">
                                    <td><span t-out="line.get('date')"/></td>
                                    <td><span t-out="line.get('activity')"/></td>
                                    <td><span t-out="line.get('due_date')"/></td>
                                    <td class="text-end">
                                        <span t-out="line.get('amount')" t-options="{'widget': 'monetary', 'display_currency': doc.company_id.currency_id}"/>
                                    </td>
                                    <td class="text-end">
                                        <span t-out="line.get('balance')" t-options="{'widget': 'monetary', 'display_currency': doc.company_id.currency_id}"/>
                                    </td>
                                </tr>
                            </tbody>
                        </table>

                        <!-- Aging Analysis -->
                        <div style="margin-top: 40px;">
                            <h3 style="border-bottom: 1px solid #000;">AGING ANALYSIS</h3>
                            <t t-set="aging_data" t-value="doc._get_aging_data()"/>
                            <table class="table" style="width: 100%;">
                                <tr>
                                    <td class="text-center"><strong>Current</strong></td>
                                    <td class="text-center"><strong>1-30 Days</strong></td>
                                    <td class="text-center"><strong>31-60 Days</strong></td>
                                    <td class="text-center"><strong>61-90 Days</strong></td>
                                    <td class="text-center"><strong>Over 90 Days</strong></td>
                                </tr>
                                <tr>
                                    <td class="text-center" t-out="aging_data.get('current', 0.0)" t-options="{'widget': 'monetary'}"/>
                                    <td class="text-center" t-out="aging_data.get('1-30', 0.0)" t-options="{'widget': 'monetary'}"/>
                                    <td class="text-center" t-out="aging_data.get('31-60', 0.0)" t-options="{'widget': 'monetary'}"/>
                                    <td class="text-center" t-out="aging_data.get('61-90', 0.0)" t-options="{'widget': 'monetary'}"/>
                                    <td class="text-center" t-out="aging_data.get('over_90', 0.0)" t-options="{'widget': 'monetary'}"/>
                                </tr>
                            </table>
                        </div>
                    </div>
                </t>
            </t>
        </t>
    </template>
</odoo>

0
Avatar
Descartar
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Mejor respuesta

Hi,


You are not inheriting a view, but you're defining a standalone QWeb report template, which means your outer <template> should not have a parent reference, and your XML needs proper registration.


Try the following.


Change the template as,


<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- PDF Template for Customer Statement -->
<template id="report_customer_statement_aged">
<t t-name="zra_smart_invoice.report_customer_statement_aged">
<t t-call="web.external_layout">
<t t-foreach="docs" t-as="doc">
<div class="page">
<!-- Your layout here -->
</div>
</t>
</t>
</t>
</template>
</odoo>


Ensure you are using t-name, not nesting inside another <template> tag unless you are explicitly inheriting. Also, use web.external_layout or your custom layout like zra_smart_invoice.external_layout only if it exists.


Hope it helps

0
Avatar
Descartar
Avatar
Christoph Farnleitner
Mejor respuesta

The three most likely reasons for Element 'x' cannot be located in parent view are:

  • it really just doesn't exist
  • typos
  • the sequence of loading data and view files or the records inside

While you will have to check for typos on your own, the second reason, sequence of loading, means that 'zra_smart_invoice.report_customer_statement_aged' must be defined prior to it being used (i.e. in the data key in your manifest make sure the file holding the definition is loaded before anything that needs it; and, inside one xml file, make sure it is likewise defined prior to being used).

Here however, I have no idea what <t t-name="zra_smart_invoice.report_customer_statement_aged"> is supposed to be as it seems to be the same as the template it is actually using.

0
Avatar
Descartar
¿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
more labels to a ledger XML data odoo 10
xml xml_id
Avatar
0
ene 18
3842
Why required attr used on field in xml doesn't work in V17? Resuelto
xml Technical odoo17
Avatar
Avatar
Avatar
2
jun 25
5289
Issues with Populating Odoo's Customer Statements Report and Sending via Email Using XML Template
xml attachments odoo17
Avatar
1
ago 24
2324
Odoo 17 generating blank QWeb.
xml qweb odoo17
Avatar
0
ago 24
2553
readonly to a group and when the stage is in 2, 3, 4
xml studio odoo17
Avatar
Avatar
1
jun 24
2265
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