mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
[FIX] web_auto_paginate: servers can respond in their own time, don't rely on timeouts
This commit is contained in:
@@ -5,15 +5,21 @@ odoo.define('web_auto_paginate.action_manager', function (require) {
|
||||
|
||||
ActionManager.include({
|
||||
_executeCloseAction: function (action, options) {
|
||||
var res = this._super(action, options);
|
||||
if (action.auto_paginate) {
|
||||
var $_o_pager_next = $('button.o_pager_next');
|
||||
if ($_o_pager_next.length >= 1) {
|
||||
setTimeout(function(){$_o_pager_next[0].click()}, 500)
|
||||
}
|
||||
res.then(auto_next_record);
|
||||
}
|
||||
return this._super(action, options);
|
||||
return res;
|
||||
}
|
||||
});
|
||||
|
||||
function auto_next_record() {
|
||||
var $_o_pager_next = $('button.o_pager_next');
|
||||
if ($_o_pager_next.length >= 1) {
|
||||
$_o_pager_next = $_o_pager_next[0];
|
||||
$_o_pager_next.click();
|
||||
}
|
||||
}
|
||||
|
||||
return ActionManager;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user