HOW TO ADD BUTTON IN TREE VIEW HEADER NEAR “CREATE” AND “IMPORT” BUTTONS ODOO10
來自:https://supportuae.wordpress.com/2017/09/06/how-to-add-button-in-tree-view-header-near-create-and-import-buttons-odoo10/
1). I create some js script (tree_menu/static/src/js/tree_view_button.js) with click listener for my button :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | |
2). After that, create tree_menu/static/src/xml/tree_view_button.xml with the template, which replaces “Create” button if I use project.project model
1 2 3 4 5 6 7 8 9 | |
3). After that, add js script in web.asset_backend (Create file tree_menu/views/tree_view_asset.xml)
1 2 3 4 5 6 7 8 9 10 | |
4). And finally, add in __manifest__.py section ‘qweb’ for ‘qweb’: [‘static/src/xml/tree_view_button.xml’], and place file views/project.xml in ‘data’ section.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | |