Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How to hide searchbar and pager for specific view

By
youring
on 6/13/14, 8:19 PM 1,502 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
                });
            }

2
Thomas Fossoul
On 10/29/14, 10:05 AM

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
            }
        };

 

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

youring
on 3/20/15, 11:32 AM
0
Juan José Scarafía
On 6/16/14, 11:43 AM

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

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.

youring
on 6/17/14, 9:58 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 6/13/14, 8:19 PM
Seen: 1502 times
Last updated: 3/20/15, 5:28 PM