In odoo 16 I cannot add buttons to the top of list view. I have seen several treads about this issue online - all with no solution. please help me with right direction to solve this issue.
Impacted versions:
16 - latest version from repo
Video/Screenshot link (optional):
https://monosnap.com/file/zyMHtPbDvhMmtryBeXON0dM8hnQ4WQ
Steps to reproduce:
- Create a new module with some models
- Have a desire to extend
ListView.buttons
with extra buttons. Let's do it! - Create a file
mu_module/static/src/xml/my_buttons.xml
<?xml version="1.0" encoding="UTF-8"?>
<templates>
<t t-extend="ListView.buttons" t-name="my_button_extension.buttons">
<t t-jquery="button.o_list_button_add" t-operation="after">
<button class="btn btn-primary import_your_action">
Jump1
</button>
</t>
</t>
</templates>
- In
__manifest__.py
add the following block of code:
'assets': {
'web.assets_backend': [
'static/src/xml/my_buttons.xml',
],
},
Current behavior:
Odoo system returns an error:
UncaughtPromiseError
Uncaught Promise > QWeb2: Can't clone undefined template 'ListView.buttons' to create 'my_button_extension.buttons'
Error: QWeb2: Can't clone undefined template 'ListView.buttons' to create 'my_button_extension.buttons'
at Object.exception (http://localhost:8069/web/assets/20-aacf356/web.assets_common.min.js:5526:7)
at Engine.add_template (http://localhost:8069/web/assets/20-aacf356/web.assets_common.min.js:5542:361)
at http://localhost:8069/web/assets/20-aacf356/web.assets_common.min.js:5601:97
Expected behavior:
In every tree/list view will appear button wuth text "Jump1".