This question has been flagged
2 Replies
12318 Views

How to hide the searchbar and pager for a particular model and specific view?

By a custom javascript module? I noticed code cited below in the views.js in the web module. tried to change the board.board to res.partner for example and view_mode to view_id ... but didn't work. Any help appreciated.


    instance.web.ViewManagerAction = instance.web.ViewManager.extend({
        template:"ViewManagerAction",
        /**
        * @constructs instance.web.ViewManagerAction
        * @extends instance.web.ViewManager
        *
        * @param {instance.web.ActionManager} parent parent object/widget
        * @param {Object} action descriptor for the action this viewmanager needs to manage its views.
        */
        init: function(parent, action) {
            // dataset initialization will take the session from ``this``, so if we
            // do not have it yet (and we don't, because we've not called our own
            // ``_super()``) rpc requests will blow up.
            var flags = action.flags || {};
            if (!('auto_search' in flags)) {
                flags.auto_search = action.auto_search !== false;
            }
            if (action.res_model == 'board.board' && action.view_mode === 'form') {
                // Special case for Dashboards
                _.extend(flags, {
                    views_switcher : false,
                    display_title : false,
                    search_view : false,
                    pager : false,
                    sidebar : false,
                    action_buttons : false
                });
            }

Avatar
Discard
Best Answer

I had a similar need on a project. You can download this module : https://www.odoo.com/apps/6.1/ir_action_flags_ept/

The module is on a 6.1 version. I upgrade it to a v8 version (give me your email if you want it..). You can spécify on the context of your action these following options : 

'selectable': False,    : hide the checkbox on the left on a list view which allow you to select row..
'sidebar': False,       : the menu on the middle disapear.
'radio': True,          : the checkbox are replaced by a radio button
'deletable': False,     : Not sure this one works..
'action_buttons': False : the create/edit/cancel button disapear.

Some other not tested :

        action.flags = {

            search_view : false,
           views_switcher : false,
            pager: false,
            low_profile: true,
            display_title: false,
            list: {
                selectable: false
            }
        };

 

Avatar
Discard
Author

Hi Thomas, thanks very much. Please send to youring at gmail dot com. Appreciated!

Hi! May I request for the version 8 or higher module of this? Please send to nathaniel dot aquino28 at gmail dot com. Thank you!

Best Answer

Hi youring,

Hide filter and Odoo paging is something that can not be possible in a 99%. You can save defaults search when you get in an specific view using "Custom Filters".

Regards,

Juan José - Ing ADHOC

Avatar
Discard
Author

Hi Juan. Thanks for your comments. I agree its probably not possible by configuration. But I believe it can be done by a custom web module. Maybe my question should be changed. see updates.