Skip to Content
Odoo Menu
  • Prisijungti
  • Išbandykite nemokamai
  • Programėlės
    Finansai
    • Apskaita
    • Pateikimas apmokėjimui
    • Sąnaudos
    • Skaičiuoklė (BI)
    • Dokumentai
    • Pasirašymas
    Pardavimai
    • CRM
    • Pardavimai
    • Kasų sistema - Parduotuvė
    • Kasų sistema - Restoranas
    • Prenumeratos
    • Nuoma
    Svetainės
    • Svetainių kūrėjimo įrankis
    • El. Prekyba
    • Internetinis Tinklaraštis
    • Forumas
    • Tiesioginis pokalbis
    • eMokymasis
    Tiekimo grandinė
    • Atsarga
    • Gamyba
    • PLM
    • Įsigijimai
    • Priežiūra
    • Kokybė
    Žmogaus ištekliai
    • Darbuotojai
    • Įdarbinimas
    • Atostogos
    • Įvertinimai
    • Rekomendacijos
    • Transporto priemonės
    Rinkodara
    • Socialinė rinkodara
    • Rinkodara el. paštu
    • SMS rinkodara
    • Renginiai
    • Rinkodaros automatizavimas
    • Apklausos
    Paslaugos
    • Projektas
    • Darbo laiko žiniaraščiai
    • Priežiūros tarnyba
    • Pagalbos tarnyba
    • Planavimas
    • Rezervacijos
    Produktyvumas
    • Diskucija
    • Patvirtinimai
    • IoT
    • VoIP
    • Žinių biblioteka
    • WhatsApp
    Trečiųjų šalių programos Odoo Studija Odoo debesijos platforma
  • Pramonės šakos
    Mažmeninė prekyba
    • Knygynas
    • Drabužių parduotuvė
    • Baldų parduotuvė
    • Maisto prekių parduotuvė
    • Techninės įrangos parduotuvė
    • Žaislų parduotuvė
    Food & Hospitality
    • Barai ir pub'ai
    • Restoranas
    • Greitasis maistas
    • Guest House
    • Gėrimų platintojas
    • Hotel
    Nekilnojamasis turtas
    • Real Estate Agency
    • Architektūros įmonė
    • Konstrukcija
    • Estate Managament
    • Sodininkauti
    • Turto savininkų asociacija
    Konsultavimas
    • Accounting Firm
    • Odoo Partneris
    • Marketing Agency
    • Teisinė firma
    • Talentų paieška
    • Auditai & sertifikavimas
    Gamyba
    • Textile
    • Metal
    • Furnitures
    • Maistas
    • Brewery
    • Įmonių dovanos
    Sveikata & Fitnesas
    • Sporto klubas
    • Akinių parduotuvė
    • Fitneso Centras
    • Sveikatos praktikai
    • Vaistinė
    • Kirpėjas
    Trades
    • Handyman
    • IT įranga ir palaikymas
    • Saulės energijos sistemos
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Kiti
    • Nonprofit Organization
    • Aplinkos agentūra
    • Reklaminių stendų nuoma
    • Fotografavimas
    • Dviračių nuoma
    • Programinės įrangos perpardavėjas
    Browse all Industries
  • Bendrija
    Mokykitės
    • Mokomosios medžiagos
    • Dokumentacija
    • Sertifikatai
    • Mokymai
    • Internetinis Tinklaraštis
    • Tinklalaidės
    Skatinkite švietinimą
    • Švietimo programa
    • Scale Up! Verslo žaidimas
    • Aplankykite Odoo
    Gaukite programinę įrangą
    • Atsisiųsti
    • Palyginkite versijas
    • Leidimai
    Bendradarbiauti
    • Github
    • Forumas
    • Renginiai
    • Vertimai
    • Tapkite partneriu
    • Services for Partners
    • Registruokite jūsų apskaitos įmonę
    Gaukite paslaugas
    • Susiraskite partnerį
    • Susirask buhalterį
    • Susitikti su konsultantu
    • Diegimo paslaugos
    • Klientų rekomendavimas
    • Palaikymas
    • Atnaujinimai
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Gaukite demo
  • Kainodara
  • Pagalba

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

  • CRM
  • e-Commerce
  • Apskaita
  • Atsarga
  • PoS
  • Projektas
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
Pagalba

TypeError: 'NoneType' object is not subscriptable odoo17

Prenumeruoti

Get notified when there's activity on this post

This question has been flagged
inheritanceerrorsNoneTypeodoo17
1 Atsakyti
1505 Rodiniai
Portretas
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
Portretas
Atmesti
Portretas
Cybrosys Techno Solutions Pvt.Ltd
Best Answer

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
Portretas
Atmesti
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registracija
Related Posts Replies Rodiniai Veikla
Default button inheritance
inheritance odoo17
Portretas
Portretas
1
rugs. 24
1849
Replacing view_id with inheritance
inheritance view_id odoo17
Portretas
Portretas
1
rugs. 24
1594
Replacing view_id with inheritance
inheritance view_id odoo17
Portretas
0
rugs. 24
1199
Error in OWL constructor inherit from stock_barcode module Solved
inheritance owl OWL odoo17
Portretas
Portretas
1
saus. 25
2438
Element cannot be located in parent view ERROR. vOdoo17
xml errors xml_id elements odoo17
Portretas
Portretas
Portretas
2
birž. 25
1357
Bendrija
  • Mokomosios medžiagos
  • Dokumentacija
  • Forumas
Atvirasis kodas
  • Atsisiųsti
  • Github
  • Runbot
  • Vertimai
Paslaugos
  • Odoo.sh talpinimas
  • Palaikymas
  • Atnaujinti
  • Pritaikytas programavimo kūrimas
  • Švietimas
  • Susirask buhalterį
  • Susiraskite partnerį
  • Tapkite partneriu
Apie mus
  • Mūsų įmonė
  • Prekės ženklo turtas
  • Susisiekite su mumis
  • Darbo pasiūlymai
  • Renginiai
  • Tinklalaidės
  • Internetinis Tinklaraštis
  • Klientai
  • Teisinis • Privatumas
  • Saugumas
الْعَرَبيّة 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 yra atvirojo kodo verslo programų rinkinys, kuris apima visas įmonės poreikius: CRM, El. Prekybą, Apskaitą, Atsargų, Kasų sistemą, Projektų valdymą ir kt.

Unikali Odoo vertės pasiūla – būti tuo pačiu metu labai lengvai naudojama ir visiškai integruota sistema.

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