Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
515 Vistas

Hi everyone,


I'm working with Odoo 18 and have added some custom cards to the portal using the following custom modules: `customer_notes_odoo`, `calendar_meeting_portal`, and `contacts_patient`.


The cards were built by replicating the structure used in Odoo core, including both the XML views and the Python controller. However, when I load the portal, I get the following error in the browser console:


UncaughtPromiseError > TypeError

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

Occurred on rileysrl.odoo.com on 2025-05-31 at 15:38:50 GMT


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

    at https://rileysrl.odoo.com/web/assets/3/842f403/web.assets_frontend_lazy.min.js:8551:2095

    at Array.forEach (<anonymous>)

    at https://rileysrl.odoo.com/web/assets/3/842f403/web.assets_frontend_lazy.min.js:8551:1951

    at async Promise.all (index 2)


This only happens with the new custom cards. The default cards from Odoo work fine.


Does anyone have an idea of what might be causing this? Could it be that a DOM element expected by the JS isn't found or properly initialized?


Happy to share any additional code or details if needed. Thanks in advance for your help!


Avatar
Descartar
Mejor respuesta

Compare your card HTML with a working Odoo portal card (like quotations or invoices).

Make sure each card has these elements inside

<div class="o_portal_docs">

    <div class="o_portal_doc_name">My Card Title</div>

    <div class="o_portal_doc_count">0</div>

</div>

  1. Ensure IDs/classes match what Odoo’s JS expects.
    (Most common missing: .o_portal_doc_name, .o_portal_doc_count)

Example Card Fix:
<t t-name="your_module_name.card_template">

    <div class="col-lg-4 col-md-6 o_portal_card">

        <a t-attf-href="/my/your_custom_route">

            <div class="o_portal_docs">

                <div class="o_portal_doc_name">My Custom Card</div>

                <div class="o_portal_doc_count">0</div>

            </div>

        </a>

    </div>

</t>




Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
dic 18
6176
0
ago 16
2905
1
may 25
702
1
may 25
906
2
may 25
1268