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
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>