Skip to Content
Menú
This question has been flagged
2 Respostes
259 Vistes

I'm currently working on a custom module in Odoo 18 (dev version) and ran into several warnings when starting the server and updating my module:


WARNING odoo.addons.base.models.ir_qweb: Unknown directives or unused attributes: {'t-call-assets', 't-js'} in web.webclient_bootstrap 
WARNING odoo.addons.base.models.ir_qweb: Unknown directives or unused attributes: {'t-call-assets'} in web.webclient_bootstrap
WARNING odoo.addons.base.models.ir_qweb: Unknown directives or unused attributes: {'t-call-assets'} in web.conditional_assets_tests
WARNING odoo.addons.base.models.ir_qweb: Found deprecated directive @t-esc="title or 'Odoo'" in template 180. Replace by @t-out
WARNING odoo.addons.base.models.ir_qweb: Found deprecated directive @t-esc='request.csrf_token(None)' in template 180. Replace by @t-out
WARNING odoo.addons.base.models.ir_qweb: Found deprecated directive @t-esc='debug' in template 180. Replace by @t-out

  • I'm using web_icon="estate,static/description/icon.png" in my menuitem.

  • I recently re-created the static directory after accidentally deleting it.

  • These warnings appear even after clearing the cache and restarting the server.

  • Dev mode is enabled.


Questions:

How should I correctly handle t-call-assets or avoid the warning if it's not meant to be used?

Avatar
Descartar
Best Answer

Hello

Use "t-out" instead of "t-esc" to fix your mistake

if it doesn't work


try



<odoo>
  <data>
    <template
      id="my_module_assets_backend"
      inherit_id="web.assets_backend"
      name="My Module Web Assets">
      <xpath expr="." position="inside">
        <!-- your JS -->
        <script
          type="text/javascript"
          src="/my_module/static/src/js/my_script.js"/>
        <!-- your CSS -->
        <link
          rel="stylesheet"
          href="/my_module/static/src/css/my_style.css"/>
      </xpath>
    </template>
  </data>
</odoo>

Adding it to the web.assets_backend package



mainerror

Templates like web.webclient_bootstrap and web.conditional_assets_tests are treated as "normal" QWeb fragments, and here t-call-assets does not know what the t-js or t-css attributes mean, so it throws the error

end

Avatar
Descartar
Best Answer

Hey! Those warnings can be tricky. It sounds like you might need to double-check your template syntax, especially with the deprecated directives. Have you tried updating those @t-esc directives to @t-out as suggested? That might help clear up some of the warnings.

Avatar
Descartar
Related Posts Respostes Vistes Activitat
1
d’abr. 25
644
1
d’abr. 25
227
2
d’abr. 25
496
2
de des. 24
664
0
d’abr. 25
314