Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

241
Views
use JS in Odoo inheriting from website.assets_frontend

I am trying to use my own Javascript in an odoo module, something to test, but I get a template error. This is my views/template.xml

<odoo>
    <data>
        <template id="assets_frontend" name="library_website_assets" inherit_id="website.assets_frontend">
            <xpath expr="." position="inside">
                <script type="text/javascript" src="/upobeer/static/src/js/functions.js"></script>
            </xpath>
        </template>
    </data>
</odoo>

And my static/src/js/functions.js

odoo.define('upobeer.library_website_assets', function (require) {
    'use strict';
    console.log('JS is work');
});

however, when installing the module I get this error

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 643, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 301, in _handle_exception
    raise exception.with_traceback(None) from new_cause
odoo.tools.convert.ParseError: while parsing None:4, somewhere inside
<data name="library_website_assets" inherit_id="website.assets_frontend">
            <xpath expr="." position="inside">
                <script type="text/javascript" src="/upobeer/static/src/js/functions.js"/>
            </xpath>
        </data>

I have views/templates.xml added in manifest.py

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

the correct views/template.xml is

<odoo>
    <data>
        <template id="assets_frontend" name="library_website_assets" inherit_id="website.assets_frontend">
            <xpath expr="." position="inside">
                <script type="text/javascript" src="/upobeer/static/src/js/functions.js"></script>
            </xpath>
        </template>
    </data>
</odoo>
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!