0
votes

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.

2

2 Answers

1
votes

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

0
votes

Would you like remove the print from only one view of the model or for each view of the model?