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

Custom portal code: Pop up Error

Iscriviti

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

La domanda è stata contrassegnata
development
1 Rispondi
2134 Visualizzazioni
Avatar
Karishma Dookhit

I have created a module for displaying information on a portal. I have restarted the server and upgraded the module. however, when navigating on the portal, i got a pop-up error and when i closed the pop - up, i got the never-ending loading icon. 


Here is the controller code:


error:

UncaughtPromiseError > TypeError


Uncaught Promise > Cannot set properties of null (setting 'textContent')


Occured on localhost:8069 on 2025-04-24 12:48:44 GMT


TypeError: Cannot set properties of null (setting 'textContent')

    at http://localhost:8069/web/assets/c2de72e/web.assets_frontend_lazy.min.js:8417:2095

    at Array.forEach (<anonymous>)

    at http://localhost:8069/web/assets/c2de72e/web.assets_frontend_lazy.min.js:8417:1951

    at async Promise.all (index 0)



Here is the controller code:

from odoo.addons.portal.controllers.portal import CustomerPortal

from odoo import http

from odoo.http import request

 

class WeblearnsPortal(CustomerPortal):

    def _prepare_home_portal_values(self,counters):

        values = super(WeblearnsPortal, self)._prepare_home_portal_values(counters)

        student_counts = http.request.env['track.trace'].search_count([])

        values.update({

            'student_counts': student_counts

        })

        return values

Here is the template code:

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

<odoo>

 

    <template id="portal_my_home" name="Demo Records" inherit_id="portal.portal_my_home">

        <xpath expr="//div[hasclass('o_portal_docs')]" position="inside">

            <t t-if="student_counts" t-call="portal.portal_docs_entry">

                <t t-set="url">/my/students</t>

                <t t-set="title">Trace</t>

                <t t-set="count" t-value="student_counts"/>

                <t t-set="config_card" t-value="True"/>

            </t>

        </xpath>

    </template>

 

</odoo>

I wish to have something like below:

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

Hi,

Please update your code like this:-


In .py file


from odoo.addons.portal.controllers.portal import CustomerPortal


from odoo import http


from odoo.http import request



class WeblearnsPortal(CustomerPortal):


  def _prepare_home_portal_values(self, counters):

      values = super()._prepare_home_portal_values(counters)

      if 'student_count' in counters:

          values['student_count'] = http.request.env['track.trace'].search_count([])

      return values



In xml file

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

<odoo>

  <template id="portal_my_home_students" name="Demo Records"

            inherit_id="portal.portal_my_home">

      <xpath expr="//div[hasclass('o_portal_docs')]" position="inside">

          <t t-call="portal.portal_docs_entry">

              <t t-set="title">Students</t>

              <t t-set="url" t-value="'/my/students'"/>

              <t t-set="placeholder_count" t-value="'student_count'"/>

              <t t-set="show_count" t-value="True"/>

              <t t-set="count" t-value="student_count"/>

          </t>

      </xpath>

  </template>

</odoo>


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à
Feature Request: Native “Dialog Filters” in Search Panel
development
Avatar
0
nov 25
158
Solution to the Getting Started tutorial from the official Odoo 16 documentation
development
Avatar
Avatar
Avatar
2
nov 25
1526
How do I change the name of the module, or rather the name assigned to the module, after I created it in Odoo Studio?
development
Avatar
1
nov 25
370
Guest House Module - Rental Search Bar
development
Avatar
Avatar
1
nov 25
241
How to make all branches for user active automatically after login his account?
development
Avatar
Avatar
Avatar
3
nov 25
436
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