Odoo Help

0

How could I unfold the drawer by default in the search view at the top?

By
Pascal Tremblay
on 1/10/15, 3:34 PM 2,243 views

Hello all,

How could I unfold, by default, this advanced search view in a particular view? It is not displayed by default.

Thanks

Update :

In the file /addons/web/static/src/xml/base.xml, even with this, the drawer only appears when we click. Not by default :

<div t-name="SearchViewDrawer" class="oe_searchview_drawer" style="display:block;">
    <div class="col-md-7"></div>
    <div class="col-md-5"></div>
</div>

???

still not found.

Pascal Tremblay
on 1/14/15, 7:54 AM

Somebody has a solution for this?

Pascal Tremblay
on 7/11/15, 6:09 AM
3

Hello Pascal,

Your problem is very easy to deal with.

Here I am giving the place where you need to change. However you need to extend the code yourself in your custom module. (I guess you know how to build custom web module)

Step 1 : Go to web/static/src/js folder and open search.js file

In class instance.web.SearchView there is one function named as start. You need to change your code here.

Step 2 : Little change in start function. 

From line no. 440 to 445 (this the updated Odoo of july 11, 2015 from github) you will find this code block,

        if (view_manager) {
            this.view_manager = view_manager;
            view_manager.on('switch_mode', this, function (e) {
                self.drawer.toggle(e === 'graph');
            });
        }

You just need to replace following line,

self.drawer.toggle(e === 'graph'); 

with this line, 

self.drawer.toggle(e!=='form'); 

So finally that code block will look like as follows,

        if (view_manager) {
this.view_manager = view_manager;
view_manager.on('switch_mode', this, function (e) {
//self.drawer.toggle(e === 'graph');
self.drawer.toggle(e!=='form');
});
}


Reason of why I replaced line :  By default only at "graph" view, search view was showing unfolded. I made search view unfolded in every view except "form" view.

Perfact Solution : You can make your custom web module, extend the class instance.web.SearchView & override the function "start". It is very easy. 

Suggetion : Never do direct change on base addons of Odoo. Once you update from git, all your custom changes will be deleted.

Finally I hope this post will help you to achieve exactly what you want.  "(whew):skype"

Latest update : This module is freely available at this link .

You are great. I will try it soon!!!!1

Pascal Tremblay
on 7/11/15, 11:09 AM

Hello Pascal, Empiro Tech... this is a related question: https://www.odoo.com/forum/help-1/question/expand-search-results-by-default-83657 .... if possible, could you please have a look at this and let me know in case you have some idea? I think some JS tweaking should do the trick for my question as well, but I'm not able to get it right.

ePillars Systems LLC, Shawn Varghese
on 7/11/15, 11:32 AM

Hello Shawn, Already that module is available at Odoo shop. https://www.odoo.com/apps/modules/8.0/web_search_results_unfold/

Emipro Technologies Pvt. Ltd.
on 7/12/15, 6:18 AM

Oh ok. Thanks !

ePillars Systems LLC, Shawn Varghese
on 7/14/15, 12:14 PM
0
Zbik
On 1/10/15, 3:48 PM

UPDATE: I removed my answer

PS. If you have edited and changed the question after answer, my answer has become stupid. It is not fair.

 

ok. I try it an I come back here. THANKS

Pascal Tremblay
on 1/10/15, 3:49 PM

With this tip, the advanced search view will be expanded?

Pascal Tremblay
on 1/10/15, 4:13 PM

sorry zbik. 1000 excuses. It won't arrive anymore.

Pascal Tremblay
on 1/10/15, 5:48 PM

About This Community

This platform 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.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

3 follower(s)

Stats

Asked: 1/10/15, 3:34 PM
Seen: 2243 times
Last updated: 8/4/15, 12:20 AM