From 5b9d39e1d1c7436199cddec40425b8b811eafc53 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Mon, 14 Jul 2014 16:21:07 +0200 Subject: [PATCH] [ADD] web_ir_actions_act_window_page --- web_ir_actions_act_window_page/__init__.py | 20 ++++++ web_ir_actions_act_window_page/__openerp__.py | 58 ++++++++++++++++++ .../static/src/img/icon.png | Bin 0 -> 7939 bytes .../src/js/web_ir_actions_act_window_page.js | 48 +++++++++++++++ 4 files changed, 126 insertions(+) create mode 100644 web_ir_actions_act_window_page/__init__.py create mode 100644 web_ir_actions_act_window_page/__openerp__.py create mode 100644 web_ir_actions_act_window_page/static/src/img/icon.png create mode 100644 web_ir_actions_act_window_page/static/src/js/web_ir_actions_act_window_page.js diff --git a/web_ir_actions_act_window_page/__init__.py b/web_ir_actions_act_window_page/__init__.py new file mode 100644 index 00000000..f6974117 --- /dev/null +++ b/web_ir_actions_act_window_page/__init__.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# This module copyright (C) 2013 Therp BV (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## diff --git a/web_ir_actions_act_window_page/__openerp__.py b/web_ir_actions_act_window_page/__openerp__.py new file mode 100644 index 00000000..f90b9ab6 --- /dev/null +++ b/web_ir_actions_act_window_page/__openerp__.py @@ -0,0 +1,58 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# This module copyright (C) 2013 Therp BV (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## +{ + "name": "Window actions for client side paging", + "version": "1.0", + "author": "Therp BV", + "complexity": "normal", + "description": """ +Client side paging +===================== + +This addon enables buttons to return:: + +{'type': 'ir.actions.act_window.page.next'} + +or:: + +{'type': 'ir.actions.act_window.page.prev'} + +which trigger the form's controller to page into the requested direction. + """, + "category": "Dependency", + "depends": [ + 'web', + ], + "data": [ + ], + "js": [ + 'static/src/js/web_ir_actions_act_window_page.js', + ], + "css": [ + ], + "qweb": [ + ], + "auto_install": False, + "installable": True, + "external_dependencies": { + 'python': [], + }, +} diff --git a/web_ir_actions_act_window_page/static/src/img/icon.png b/web_ir_actions_act_window_page/static/src/img/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..f1006195e0220e5b38e4a1b8f17870ec9359f7bb GIT binary patch literal 7939 zcmV+eAN=5nP)2wk@lR!X%5@omqLQoK55FAmjS7i{dSA3$P zzIWGpF5g@Fp8Bp&ukT*H4h$*?s1O4r5R!C8GIo+qce>N_R9$1&8TQ`qkF!s8b*BRX zFM%xBD`!=8)j6lCzVrQlzwbAk0Pn1K);sGwUgQlvKLcO_2muHHpa2{I;{b91Tmb5P z29UkM7bgIq6hIw-nE+}46zlg~00Mw~J2IC7-~bH$NT*>l2T%@R#m0?)eR5!6#2OkJ zwfYB!GR@7+>j2CG5T53^!gCw?B9pf=5U-V0hW_Ct8lY0mDpQ}2>K`4_@6BwQGxy!x zFigg|X_|rXefNE7LjfBLkK+J>1?MgU5GgSK^BzE^!K(t$w07-{?`dpoTmqm$|KO

>GG0jNr_StN-8L&uw?17%KDt|b@K@T5Q5>Mp~PoC{qdi)w6vVK?6S*CKJu}Tt(w!+Jh!H% zrnaJ@BE~qU{=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fv3NT$@U->FBkRSK!fqdcgml%9T*sY32vJgq tN6+Hech)=Wo%POoXT7uDS#R0({{b$rzUWE6E0F*I002ovPDHLkV1nr_+@t^i literal 0 HcmV?d00001 diff --git a/web_ir_actions_act_window_page/static/src/js/web_ir_actions_act_window_page.js b/web_ir_actions_act_window_page/static/src/js/web_ir_actions_act_window_page.js new file mode 100644 index 00000000..59a107e1 --- /dev/null +++ b/web_ir_actions_act_window_page/static/src/js/web_ir_actions_act_window_page.js @@ -0,0 +1,48 @@ +//-*- coding: utf-8 -*- +//############################################################################ +// +// OpenERP, Open Source Management Solution +// This module copyright (C) 2013 Therp BV (). +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . +// +//############################################################################ + +openerp.web_ir_actions_act_window_page = function(openerp) +{ + openerp.web.ActionManager.include({ + ir_actions_act_window_page_prev: function(action, options) + { + if(this.inner_viewmanager && + (this.inner_viewmanager.active_view == 'form' || + this.inner_viewmanager.active_view == 'page' ) && + this.inner_viewmanager.views[this.inner_viewmanager.active_view]) + { + this.inner_viewmanager.views[this.inner_viewmanager.active_view] + .controller.on_pager_action('previous'); + } + }, + ir_actions_act_window_page_next: function(action, options) + { + if(this.inner_viewmanager && + (this.inner_viewmanager.active_view == 'form' || + this.inner_viewmanager.active_view == 'page' ) && + this.inner_viewmanager.views[this.inner_viewmanager.active_view]) + { + this.inner_viewmanager.views[this.inner_viewmanager.active_view] + .controller.on_pager_action('next'); + } + }, + }); +}