Skip to Content
Menu
This question has been flagged

Hi i am using odoo 11 and ve added Button along Create and Import buttons. That button is Export button see figure for understanding:

[![enter image description here][1]][1]

Basically i am overriding and those Create and Import are in build. I placed them here bcz my custom button was replacing them so i also placed Create and Import along.

But with respect to **Export** button and Jquery i ve problem that button does nt responds with jquery.

My Modules and files

**web_export_view\web_export_view\static\src\xml\web_export_view_template.xml:**

<?xml version="1.0" encoding="UTF-8"?>

<templates id="template" xml:space="preserve">

<t t-name="ListView.buttons">

<div class="o_list_buttons">

<t t-if="widget.is_action_enabled('create')">

<button type="button" class="btn btn-primary btn-sm o_list_button_add" accesskey="c">

Create

</button>

</t>

<button type="button" class="btn btn-primary btn-sm o_list_button_save" accesskey="s">

Save

</button>

<button type="button" class="btn btn-default btn-sm o_list_button_discard" accesskey="j">

Discard

</button>

<button class="btn btn-default export_treeview_xls" value="hh" type="button" title="Export xls">

Export

</button>

</div>

</t>

</templates>

**web_export_view\web_export_view\static\src\js\web_export_view.js**

odoo.define('web_export_view', function (require) {

"use strict";

var core = require('web.core');

var ListView = require('web.ListView');

var QWeb = core.qweb;

var _t = core._t;

ListView.include({

redraw: function () {

var self = this;

events: {

"click .export_treeview_xls": "your_function",

},

your_function: function () {

alert('Button Clicked');

},

});

});

**web_export_view\web_export_view\views\web_export_view_view.xml**

<?xml version="1.0" encoding="utf-8"?>

<odoo>

<template id="assets_backend" name="web_export_view assets" inherit_id="web.assets_backend">

<xpath expr="." position="inside">

<script type="text/javascript" src="/web_export_view/static/src/js/web_export_view.js"></script>

</xpath>

</template>

</odoo>

**web_export_view\manifest**

{

'name': 'Web Export Current View',

'version': '10.0.1.0.0',

'category': 'Web',

'author': 'Me',

'depends': [

'web',

],

"data": [

'views/web_export_view_view.xml',

],

'qweb': [

"static/src/xml/web_export_view_template.xml",

],

'installable': True,

'auto_install': False,

}

[1]: https://i.stack.imgur.com/g5TlG.png

Kindly help...........









Avatar
Discard
Author

anyone??

Related Posts Replies Views Activity
2
Jul 22
10577
1
May 21
2242
2
May 20
8534
1
Jan 20
4029
1
Aug 19
3256