mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
[ADD] web_auto_paginate: for Odoo 12
This commit is contained in:
0
web_auto_paginate/__init__.py
Normal file
0
web_auto_paginate/__init__.py
Normal file
17
web_auto_paginate/__manifest__.py
Normal file
17
web_auto_paginate/__manifest__.py
Normal 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,
|
||||
}
|
||||
19
web_auto_paginate/static/src/js/action_manager.js
Normal file
19
web_auto_paginate/static/src/js/action_manager.js
Normal 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;
|
||||
});
|
||||
8
web_auto_paginate/views/web_views.xml
Normal file
8
web_auto_paginate/views/web_views.xml
Normal 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>
|
||||
Reference in New Issue
Block a user