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: