I have created an action client but, it is being called from a custom button into another view and not from a menuitem option and it does not work.
What am I doing wrong?
Button where the action is being called:
<button name="%(action_client_name)d" string="Load"
type="action" class="oe_stat_button" icon="fa-search"/>
XML File:
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data>
<template id="assets_backend" name="static_resources assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript" src="/my_module/static/src/js/load.js"/>
</xpath>
</template>
<record id="action_client_name" model="ir.actions.client">
<field name="name">Some Name</field>
<field name="tag">some.name</field>
<field name="target">new</field>
</record>
</data>
</odoo>
Javascript code:
odoo.my_module = function (instance, local) {
var _t = instance.web._t,
_lt = instance.web._lt;
var QWeb = instance.web.qweb;
local.TestWidget = instance.Widget.extend({
start: function() {
console.log("Testing if it works...");
}
});
instance.web.client_actions.add('some.name', 'instance.my_module.TestWidget');
};