[ADD] web_auto_paginate: for Odoo 12

This commit is contained in:
Jared Kipe
2020-12-22 11:29:33 -08:00
parent ab02d8d836
commit 13814f4e37
4 changed files with 44 additions and 0 deletions

View File

View File

@@ -0,0 +1,17 @@
{
'name': 'Web Auto Paginate',
'version': '12.0.1.0.0',
'author': 'Hibou Corp. <hello@hibou.io>',
'website': 'https://hibou.io/',
'license': 'AGPL-3',
'category': 'Tools',
'complexity': 'expert',
'depends': [
'web',
],
'data': [
'views/web_views.xml',
],
'installable': True,
'auto_install': False,
}

View File

@@ -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;
});

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="assets_backend" name="Web Auto-Paginate Assets" inherit_id="web.assets_backend" priority='15'>
<xpath expr="//script[last()]" position="after">
<script type="text/javascript" src="/web_auto_paginate/static/src/js/action_manager.js"></script>
</xpath>
</template>
</odoo>