Skip to Content
Menu
This question has been flagged
1 Reply
3730 Views
Is there any options to remove or hide more, print and attachment buttons in a specific menu element views (tree and form view) , I tried in several ways, but i didn't find hide them.
I've try this, 

<script type="text/javascript">

$(window).ready(function() {

$('.oe_sidebar').addClass('hide');

});

</script>

in the xml file of my custom module, and also have tried , in a js file.

I think that thoose buttons are loaded after the view is loaded.

How may i hide the buttons then?


Kind regards.


Avatar
Discard
Author Best Answer

I've found a solution for my problem.

To hide more, print and attachment buttons, i've create a view named base.xml in my_module/static/src folder, with the next code

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

<templates>

    <t t-extend="Sidebar">

        <t t-jquery="div.oe_form_dropdown_section" t-operation="replace">

            <t t-if="widget.session.active_id === 516"> 

                <div class="oe_form_dropdown_section"></div>

            </t>

            <t t-if="widget.session.active_id !== 516">

                 ....... original base.xml div

             </t>

     </t>

</templates>


where 516 is the id of view i want to hide buttons.

I think there has to be a way to avoid to set an id value, but right now this is working fine.


Kind Regards.

Avatar
Discard
Author

I can not modify the title of my question to add [SOLVED] in the title.

Related Posts Replies Views Activity
3
Jul 15
9526
1
Jan 23
1322
1
Mar 24
7840
2
Aug 20
7441
3
Aug 20
4023