Search code examples
odooodoo-8openerp-8

Remove print button from Form and List view Odoo 8


I need to remove Print button from Form and List view. I tried below code for Form view.

*.xml

<xpath expr="//form" position="attributes">
    <attribute name="print">1</attribute>
</xpath>

*.js

instance.web.FormView.include({
    load_form: function(data) {
        this._super(data);
        console.log('this',this.sidebar);
        if (this.is_action_enabled('print')) {
          var no_print = _.reject(this.sidebar.sections, function (item) {
              return item.label === _t('Print');
              });
              this.sections = no_print;
        }
      },
    });

But getting this error: this object has no attribute sidebar.

NOTE: console log prints two times, first it prints with some data second it prints undefined.


Solution

  • Adding the attribute menu="False" to one of your report tags will do the trick for you