Open effelle opened 8 years ago
Hi @effelle I poked around on Odoo and looked through the functions to find a correct option to refresh the View in Odoo 9. Haven't edited the one you linked.
Is there an option? Where?
@effelle an example:
var refresh_page = function(view) {
setInterval(function() {
var active_view = view.action_manager.inner_widget.active_view;
if (typeof(active_view) != 'undefined'){
try {
var controller = view.action_manager.inner_widget.active_view.controller;
var action = view.action_manager.inner_widget.action;
if (String(action.view_id).match(/Your view title/)) {
controller.reload();
}
} catch (e) {
alert(e);
}
}
}, 5000);
}
openerp.web.WebClient.include({
start: function() {
//alert("Start");
this._super();
refresh_page(this);
},
})
This will reload the view once every 5 seconds.
Ok, this is a little confusing. You are using this on a single web module or did you add @ global level? BEcause this code should work on V8 too. Did you use this code on a stock module? Have you add an example on Odoo_sample? Thanks.
@effelle I'm using this in a custom developed module to refresh one treeview. This has nothing to do with the stock module or anything.
Got it. I'll test on one of mine on V9 on the next testing. Thanks for now!
Hi Yenthe,
I have same requirements in version 9 custom module tree view auto reload particular interval. Your code is working fine, but it reloads both form and tree view, in form view loss data, is any away auto reload prevent in form view and apply only in tree view. Thanks
@Yenthe666 ,
I've read your reply on your blog just now. Sorry for the HUGE delay! How did you manage to add auto update to V9? Did you edit
https://github.com/szufisher/web/tree/8.0/web_auto_refresh module?
F.