B
B
bamond2017-09-25 11:35:40
Software and Internet Services
bamond, 2017-09-25 11:35:40

How to use your js script in addon?

Good afternoon. odoo \ openers 8
Has its own addon. There is a model with a form =)
In the xml file of this model, we include our custom js file.

<template id="assets_backend" name="addon assets" inherit_id="web.assets_backend">
            <xpath expr="." position="inside">
                <link rel="stylesheet" href="/addon/static/src/css/main.css"/>
                <script type="text/javascript" src="/addon/static/src/js/main.js"></script>
            </xpath>
        </template>

The include passes normally and the code is visible.. but when you hang up the event
$(document).on('click', '*', function() {
console.log('ok');
});
This event reacts in ANY part of the screen, except for the form (in the center) where it is needed...
Maybe there is some specifics of custom js in the ode? how to properly hang it on form in xml

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question