Passa al contenuto
Odoo Menu
  • Accedi
  • Provalo gratis
  • App
    Finanze
    • Contabilità
    • Fatturazione
    • Note spese
    • Fogli di calcolo (BI)
    • Documenti
    • Firma
    Vendite
    • CRM
    • Vendite
    • Punto vendita Negozio
    • Punto vendita Ristorante
    • Abbonamenti
    • Noleggi
    Siti web
    • Configuratore sito web
    • E-commerce
    • Blog
    • Forum
    • Live chat
    • E-learning
    Supply chain
    • Magazzino
    • Produzione
    • PLM
    • Acquisti
    • Manutenzione
    • Qualità
    Risorse umane
    • Dipendenti
    • Assunzioni
    • Ferie
    • Valutazioni
    • Referral dipendenti
    • Parco veicoli
    Marketing
    • Social marketing
    • E-mail marketing
    • SMS marketing
    • Eventi
    • Marketing automation
    • Sondaggi
    Servizi
    • Progetti
    • Fogli ore
    • Assistenza sul campo
    • Helpdesk
    • Pianificazione
    • Appuntamenti
    Produttività
    • Comunicazioni
    • Approvazioni
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    App di terze parti Odoo Studio Piattaforma cloud Odoo
  • Settori
    Retail
    • Libreria
    • Negozio di abbigliamento
    • Negozio di arredamento
    • Alimentari
    • Ferramenta
    • Negozio di giocattoli
    Cibo e ospitalità
    • Bar e pub
    • Ristorante
    • Fast food
    • Pensione
    • Grossista di bevande
    • Hotel
    Agenzia immobiliare
    • Agenzia immobiliare
    • Studio di architettura
    • Edilizia
    • Gestione immobiliare
    • Impresa di giardinaggio
    • Associazione di proprietari immobiliari
    Consulenza
    • Società di contabilità
    • Partner Odoo
    • Agenzia di marketing
    • Studio legale
    • Selezione del personale
    • Audit e certificazione
    Produzione
    • Tessile
    • Metallo
    • Arredamenti
    • Alimentare
    • Birrificio
    • Ditta di regalistica aziendale
    Benessere e sport
    • Club sportivo
    • Negozio di ottica
    • Centro fitness
    • Centro benessere
    • Farmacia
    • Parrucchiere
    Commercio
    • Tuttofare
    • Hardware e assistenza IT
    • Ditta di installazione di pannelli solari
    • Calzolaio
    • Servizi di pulizia
    • Servizi di climatizzazione
    Altro
    • Organizzazione non profit
    • Ente per la tutela ambientale
    • Agenzia di cartellonistica pubblicitaria
    • Studio fotografico
    • Punto noleggio di biciclette
    • Rivenditore di software
    Carica tutti i settori
  • Community
    Apprendimento
    • Tutorial
    • Documentazione
    • Certificazioni 
    • Formazione
    • Blog
    • Podcast
    Potenzia la tua formazione
    • Programma educativo
    • Scale Up! Business Game
    • Visita Odoo
    Ottieni il software
    • Scarica
    • Versioni a confronto
    • Note di versione
    Collabora
    • Github
    • Forum
    • Eventi
    • Traduzioni
    • Diventa nostro partner
    • Servizi per partner
    • Registra la tua società di contabilità
    Ottieni servizi
    • Trova un partner
    • Trova un contabile
    • Incontra un esperto
    • Servizi di implementazione
    • Testimonianze dei clienti
    • Supporto
    • Aggiornamenti
    GitHub Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Richiedi una demo
  • Prezzi
  • Aiuto

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

  • CRM
  • e-Commerce
  • Contabilità
  • Magazzino
  • PoS
  • Progetti
  • MRP
All apps
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
Assistenza

TypeError: 'NoneType' object is not subscriptable odoo17

Iscriviti

Ricevi una notifica quando c'è un'attività per questo post

La domanda è stata contrassegnata
inheritanceerrorsNoneTypeodoo17
1 Rispondi
1486 Visualizzazioni
Avatar
Elijah Nyendwa

Hello, i am trying to create a custom customer statement template in odoo17 by inheriting the exosting customer statement but i keep getting this error in the terminal whenever i click to print, i have reviewed my code, given it to AI and still nothing but the same error:


File "<2191>", line 570, in template_2191

odoo.addons.base.models.ir_qweb.QWebException: Error while render the template

TypeError: 'NoneType' object is not subscriptable

Template: zra_smart_invoice.report_customer_statement_aged

Path: /t/t/t/t/div/div[2]/table/thead/tr/th[5]/span

Node: <span t-out="env.company.currency_id.symbol"/>



in odoo but i 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>



<template id="report_customer_statement_aged" inherit_id="l10n_account_customer_statements.customer_statements">
    <xpath expr="//h2[contains(text(), 'CUSTOMER STATEMENTS')]" position="replace">
        <h2 style="font-size: 16px;">Customer Statement</h2>
    </xpath>

    <xpath expr="//div[contains(@class, 'row') and .//label[@for='balance_due']]" position="after">
        <div class="row mt32">
            <div class="col-12">
                <strong style="font-size: 1.1em;">Aging Analysis</strong>
                <table class="table table-sm mt8">
                    <thead>
                        <tr>
                            <th class="text-right">Current</th>
                            <th class="text-right">1-30 Days</th>
                            <th class="text-right">31-60 Days</th>
                            <th class="text-right">61-90 Days</th>
                            <th class="text-right">Over 90 Days</th>
                            <th class="text-right">Total Due</th>
                        </tr>
                    </thead>
                    <tbody>
                        <t t-set="aging_data" t-value="p._get_aging_data()"/>
                        <tr>
                            <td class="text-right">
                                <span t-esc="aging_data.get('current', 0.0)"
                                      t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
                            </td>
                            <td class="text-right">
                                <span t-esc="aging_data.get('1-30', 0.0)"
                                      t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
                            </td>
                            <td class="text-right">
                                <span t-esc="aging_data.get('31-60', 0.0)"
                                      t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
                            </td>
                            <td class="text-right">
                                <span t-esc="aging_data.get('61-90', 0.0)"
                                      t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
                            </td>
                            <td class="text-right">
                                <span t-esc="aging_data.get('over_90', 0.0)"
                                      t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
                            </td>
                            <td class="text-right">
                                <span t-esc="aging_data.get('total_due', 0.0)"
                                      t-options="{'widget': 'monetary', 'display_currency': env.company.currency_id}"/>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </xpath>

    <xpath expr="//th[contains(., 'Balance') and span[contains(@t-out, 'currency_id')]]" position="replace">
        <th class="text-end">Balance <span t-out="env.company.currency_id.symbol"/></th>
    </xpath>
</template>

0
Avatar
Abbandona
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Risposta migliore

Hi,


This error usually happens when the QWeb template tries to access the currency symbol using env.company.currency_id.symbol, but currency_id is missing or not properly loaded.



Solution


1- Ensure the currency symbol is properly added in the company.


2- Try with the code.


* Use 'request.env' for safer access in QWeb

<xpath expr="//th[contains(., 'Balance') and span[contains(@t-out, 'currency_id')]]" position="replace">
<th class="text-end">Balance <span t-out="request.env.company.currency_id.symbol"/></th>
</xpath>

OR


Add a condition to prevent template crash

<xpath expr="//th[contains(., 'Balance') and span[contains(@t-out, 'currency_id')]]" position="replace">
<t t-if="env.company.currency_id.symbol">
<th class="text-end">Balance <span t-out="env.company.currency_id.symbol"/></th>
</t>
</xpath>

Hope it helps

0
Avatar
Abbandona
Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!

Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!

Registrati
Post correlati Risposte Visualizzazioni Attività
Default button inheritance
inheritance odoo17
Avatar
Avatar
1
set 24
1843
Replacing view_id with inheritance
inheritance view_id odoo17
Avatar
Avatar
1
set 24
1591
Replacing view_id with inheritance
inheritance view_id odoo17
Avatar
0
set 24
1192
Error in OWL constructor inherit from stock_barcode module Risolto
inheritance owl OWL odoo17
Avatar
Avatar
1
gen 25
2430
Element cannot be located in parent view ERROR. vOdoo17
xml errors xml_id elements odoo17
Avatar
Avatar
Avatar
2
giu 25
1340
Community
  • Tutorial
  • Documentazione
  • Forum
Open source
  • Scarica
  • Github
  • Runbot
  • Traduzioni
Servizi
  • Hosting Odoo.sh
  • Supporto
  • Aggiornamenti
  • Sviluppi personalizzati
  • Formazione
  • Trova un contabile
  • Trova un partner
  • Diventa nostro partner
Chi siamo
  • La nostra azienda
  • Branding
  • Contattaci
  • Lavora con noi
  • Eventi
  • Podcast
  • Blog
  • Clienti
  • Note legali • Privacy
  • Sicurezza
الْعَرَبيّة 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 è un gestionale di applicazioni aziendali open source pensato per coprire tutte le esigenze della tua azienda: CRM, Vendite, E-commerce, Magazzino, Produzione, Fatturazione elettronica, Project Management e molto altro.

Il punto di forza di Odoo è quello di offrire un ecosistema unico di app facili da usare, intuitive e completamente integrate tra loro.

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