Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect when odoo interface is fully loaded

I need to run some javascript code to check when odoo has ended loading.

I know that querying jQuery.active == 0 does the trick in version 7 but that does not work in odoo because it always keep one connection open for the longpolling.

Does anybody know which web element can I use to check for sure when the interface is fully loaded ?

If I can query the URL of the active jQuery connections that would also do the trick.

like image 653
yucer Avatar asked May 17 '15 12:05

yucer


1 Answers

I don´t know odoo but I supose that you can wait for a variable in odoo and do this:

function checkodoo() {
   if ('undefined' !== typeof odooVariableThatYouWatch ) {
       clearInterval(intervalOdoo);
       lauchYourStaff();
   }
}

var intervalOdoo = setInterval("checkodoo()",100);

If on https://www.odoo.com the variable is openerp

I look the variable here: https://www.odoo.com/documentation/8.0/howtos/web.html

like image 151
Raúl Martín Avatar answered Nov 16 '22 17:11

Raúl Martín