Overslaan naar inhoud
Odoo Menu
  • Aanmelden
  • Probeer het gratis
  • Apps
    Financiën
    • Boekhouding
    • Facturatie
    • Onkosten
    • Spreadsheet (BI)
    • Documenten
    • Ondertekenen
    Verkoop
    • CRM
    • Verkoop
    • Kassasysteem winkel
    • Kassasysteem Restaurant
    • Abonnementen
    • Verhuur
    Websites
    • Websitebouwer
    • E-commerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Bevoorradingsketen
    • Voorraad
    • Productie
    • PLM
    • Inkoop
    • Onderhoud
    • Kwaliteit
    Personeelsbeheer
    • Werknemers
    • Werving & Selectie
    • Verlof
    • Evaluaties
    • Aanbevelingen
    • Wagenpark
    Marketing
    • Social media Marketing
    • E-mailmarketing
    • SMS Marketing
    • Evenementen
    • Marketingautomatisering
    • Enquêtes
    Diensten
    • Project
    • Urenstaten
    • Buitendienst
    • Helpdesk
    • Planning
    • Afspraken
    Productiviteit
    • Chat
    • Goedkeuringen
    • IoT
    • VoIP
    • Kennis
    • WhatsApp
    Apps van derden Odoo Studio Odoo Cloud Platform
  • Bedrijfstakken
    Detailhandel
    • Boekhandel
    • kledingwinkel
    • Meubelzaak
    • Supermarkt
    • Bouwmarkt
    • Speelgoedwinkel
    Food & Hospitality
    • Bar en Pub
    • Restaurant
    • Fastfood
    • Gastenverblijf
    • Drankenhandelaar
    • Hotel
    Vastgoed
    • Makelaarskantoor
    • Architectenbureau
    • Bouw
    • Vastgoedbeheer
    • Tuinieren
    • Vereniging van eigenaren
    Consulting
    • Accountantskantoor
    • Odoo Partner
    • Marketingbureau
    • Advocatenkantoor
    • Talentenwerving
    • Audit & Certificering
    Productie
    • Textiel
    • Metaal
    • Meubels
    • Eten
    • Brewery
    • Relatiegeschenken
    Gezondheid & Fitness
    • Sportclub
    • Opticien
    • Fitnesscentrum
    • Wellness-medewerkers
    • Apotheek
    • Kapper
    Trades
    • Klusjesman
    • IT-hardware & support
    • Zonne-energiesystemen
    • Schoenmaker
    • Schoonmaakdiensten
    • HVAC-diensten
    Andere
    • Non-profitorganisatie
    • Milieuagentschap
    • Verhuur van Billboards
    • Fotograaf
    • Fietsleasing
    • Softwareverkoper
    Browse all Industries
  • Community
    Leren
    • Tutorials
    • Documentatie
    • Certificeringen
    • Training
    • Blog
    • Podcast
    Versterk het onderwijs
    • Onderwijs- programma
    • Scale Up! Business Game
    • Bezoek Odoo
    Download de Software
    • Downloaden
    • Vergelijk edities
    • Releases
    Werk samen
    • Github
    • Forum
    • Evenementen
    • Vertalingen
    • Word een Partner
    • Services for Partners
    • Registreer je accountantskantoor
    Diensten
    • Vind een partner
    • Vind een boekhouder
    • Een adviseur ontmoeten
    • Implementatiediensten
    • Klantreferenties
    • Ondersteuning
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Vraag een demo aan
  • Prijzen
  • Help

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

  • CRM
  • e-Commerce
  • Boekhouding
  • Voorraad
  • PoS
  • Project
  • MRP
All apps
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Help

Element cannot be located in parent view ERROR. vOdoo17

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
xmlerrorsxml_idelementsodoo17
2 Antwoorden
1361 Weergaven
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
Annuleer
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Beste antwoord

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
Annuleer
Avatar
Christoph Farnleitner
Beste antwoord

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
Annuleer
Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!

Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!

Aanmelden
Gerelateerde posts Antwoorden Weergaven Activiteit
more labels to a ledger XML data odoo 10
xml xml_id
Avatar
0
jan. 18
3840
Why required attr used on field in xml doesn't work in V17? Opgelost
xml Technical odoo17
Avatar
Avatar
Avatar
2
jun. 25
5287
Issues with Populating Odoo's Customer Statements Report and Sending via Email Using XML Template
xml attachments odoo17
Avatar
1
aug. 24
2322
Odoo 17 generating blank QWeb.
xml qweb odoo17
Avatar
0
aug. 24
2552
readonly to a group and when the stage is in 2, 3, 4
xml studio odoo17
Avatar
Avatar
1
jun. 24
2264
Community
  • Tutorials
  • Documentatie
  • Forum
Open Source
  • Downloaden
  • Github
  • Runbot
  • Vertalingen
Diensten
  • Odoo.sh Hosting
  • Ondersteuning
  • Upgrade
  • Gepersonaliseerde ontwikkelingen
  • Onderwijs
  • Vind een boekhouder
  • Vind een partner
  • Word een Partner
Over ons
  • Ons bedrijf
  • Merkelementen
  • Neem contact met ons op
  • Vacatures
  • Evenementen
  • Podcast
  • Blog
  • Klanten
  • Juridisch • Privacy
  • Beveiliging
الْعَرَبيّة 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 is een suite van open source zakelijke apps die aan al je bedrijfsbehoeften voldoet: CRM, E-commerce, boekhouding, inventaris, kassasysteem, projectbeheer, enz.

Odoo's unieke waardepropositie is om tegelijkertijd zeer gebruiksvriendelijk en volledig geïntegreerd te zijn.

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