+2 votes
201 views

I'm getting trouble once how to hide 'Print' drop-down button based on the state of SO, tried on field_view_get function and js but no luck. Do we have any ideas for this solution?

enter image description here

in App by (10.5k points) | 201 views

1 Answer

+1 vote
hi

i tried with fields_view_get and it works:

@api.model

    def fields_view_get(self, view_id=None, view_type='form', toolbar=False, submenu=False):

        res = super(class_name, self).fields_view_get(view_id, view_type, toolbar=toolbar, submenu=submenu)

        request_context = self._context

        if res['type'] == 'form':

                for print_submenu in res.get('toolbar', {}).get('print', []):

                    res['toolbar']['print'].remove(print_submenu)

return res
by (6k points)
202 questions
178 answers
34 comments
111,038 users