diff --git a/web_auto_paginate/__init__.py b/web_auto_paginate/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/web_auto_paginate/__manifest__.py b/web_auto_paginate/__manifest__.py new file mode 100644 index 00000000..35437f06 --- /dev/null +++ b/web_auto_paginate/__manifest__.py @@ -0,0 +1,17 @@ +{ + 'name': 'Web Auto Paginate', + 'version': '12.0.1.0.0', + 'author': 'Hibou Corp. ', + 'website': 'https://hibou.io/', + 'license': 'AGPL-3', + 'category': 'Tools', + 'complexity': 'expert', + 'depends': [ + 'web', + ], + 'data': [ + 'views/web_views.xml', + ], + 'installable': True, + 'auto_install': False, +} diff --git a/web_auto_paginate/static/src/js/action_manager.js b/web_auto_paginate/static/src/js/action_manager.js new file mode 100644 index 00000000..185f1948 --- /dev/null +++ b/web_auto_paginate/static/src/js/action_manager.js @@ -0,0 +1,19 @@ +odoo.define('web_auto_paginate.action_manager', function (require) { + "use strict"; + + var ActionManager = require('web.ActionManager'); + + ActionManager.include({ + _executeCloseAction: function (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) + } + } + return this._super(action, options); + } + }); + + return ActionManager; +}); diff --git a/web_auto_paginate/views/web_views.xml b/web_auto_paginate/views/web_views.xml new file mode 100644 index 00000000..e0a33790 --- /dev/null +++ b/web_auto_paginate/views/web_views.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file