Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
729 Представления

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!


Аватар
Отменить
Лучший ответ

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>




Аватар
Отменить
Related Posts Ответы Просмотры Активность
1
дек. 18
6333
0
авг. 16
2980
2
июл. 25
1302
1
мая 25
818
1
мая 25
1072