In Odoo 12, 14 and 15 I have created a button next to Create/Export in List View and Kanban View, it renders and perform an action without any problem. But in Odoo 16 I am having an issue that the button is not rendering in both views.
Example List View Odoo 15:
My code is looks like this in Odoo 15:
Manifest:
"assets": {
"web.assets_backend": [
"/proyect_name/static/src/js/hr_list_view.js"
],
'web.assets_qweb': [
'/proyect_name/static/src/xml/hr_list_view.xml'
]
}
XML:
<templatesxml:space="preserve">
<tt-extend="ListView.buttons">
<tt-jquery="button.o_list_export_xlsx"t-operation="after">
<tt-if="widget.is_action_enabled('export_xlsx') and widget.isExportEnable"> <buttonid="list_view_test" t-if="widget.modelName == 'hr.employee'"type="button"class="btn btn-secondary oe_export_test o_list_export_xlsx open_wizard_action_kanban oe_highlight">Testbutton>
t>
t>
t>
templates>
Javascript:
odoo.define('export_ins.print_ins', function (require) {
"use strict";
var ListController = require('web.ListController');
var rpc = require('web.rpc');
ListController.include({
renderButtons: function ($node) {
this._super.apply(this, arguments);
if (this.modelName === "hr.employee" && this.$buttons) {
this.$buttons.find('.oe_export_test').click(this.proxy('action_def'));
}
},
action_def: function (ev) {
varself = this;
returnrpc.query({model:'hr.employee', method:'odoo_button_click_test'
},{
shadow:true
}).then(function (res) {
returnself.do_action(res)
}).catch(function (error) {
console.log(this, error.message.data.message);
});
},
});
});
How can I perform the same rendering and action but in Odoo 16?
Thanks for the response!