Merge lp:~therp-nl/web-addons/7.0-web_ir_actions_act_window_scroll into lp:~webaddons-core-editors/web-addons/7.0

Proposed by Holger Brunn (Therp)
Status: Merged
Approved by: Yannick Vaucher @ Camptocamp
Approved revision: 11
Merged at revision: 15
Proposed branch: lp:~therp-nl/web-addons/7.0-web_ir_actions_act_window_scroll
Merge into: lp:~webaddons-core-editors/web-addons/7.0
Diff against target: 142 lines (+121/-0)
3 files modified
web_ir_actions_act_window_page/__init__.py (+20/-0)
web_ir_actions_act_window_page/__openerp__.py (+57/-0)
web_ir_actions_act_window_page/static/src/js/web_ir_actions_act_window_page.js (+44/-0)
To merge this branch: bzr merge lp:~therp-nl/web-addons/7.0-web_ir_actions_act_window_scroll
Reviewer Review Type Date Requested Status
Guewen Baconnier @ Camptocamp code review Approve
Stefan Rijnhart (Opener) code review, test Approve
Review via email: mp+197168@code.launchpad.net

Description of the change

With this addon, you can have buttons that scroll the current (form-)view to the left or right

To post a comment you must log in.
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Thanks! As this module allows a developer to flip to the next or previous record from the list, should the terminology not rather be 'paging' instead of 'scrolling'?

review: Needs Information
11. By Stefan Rijnhart (Opener)

[IMP] Terminology

Revision history for this message
Holger Brunn (Therp) (hbrunn) wrote :

thank for your input!

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Thanks for taking my suggestion!

review: Approve (code review, test)
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Nice!

review: Approve (code review)
Revision history for this message
Sylvain LE GAL (GRAP) (sylvain-legal) wrote :

LGTM.

review: Approve (code review, no test)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'web_ir_actions_act_window_page'
2=== added file 'web_ir_actions_act_window_page/__init__.py'
3--- web_ir_actions_act_window_page/__init__.py 1970-01-01 00:00:00 +0000
4+++ web_ir_actions_act_window_page/__init__.py 2013-12-02 14:04:08 +0000
5@@ -0,0 +1,20 @@
6+# -*- coding: utf-8 -*-
7+##############################################################################
8+#
9+# OpenERP, Open Source Management Solution
10+# This module copyright (C) 2013 Therp BV (<http://therp.nl>).
11+#
12+# This program is free software: you can redistribute it and/or modify
13+# it under the terms of the GNU Affero General Public License as
14+# published by the Free Software Foundation, either version 3 of the
15+# License, or (at your option) any later version.
16+#
17+# This program is distributed in the hope that it will be useful,
18+# but WITHOUT ANY WARRANTY; without even the implied warranty of
19+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20+# GNU Affero General Public License for more details.
21+#
22+# You should have received a copy of the GNU Affero General Public License
23+# along with this program. If not, see <http://www.gnu.org/licenses/>.
24+#
25+##############################################################################
26
27=== added file 'web_ir_actions_act_window_page/__openerp__.py'
28--- web_ir_actions_act_window_page/__openerp__.py 1970-01-01 00:00:00 +0000
29+++ web_ir_actions_act_window_page/__openerp__.py 2013-12-02 14:04:08 +0000
30@@ -0,0 +1,57 @@
31+# -*- coding: utf-8 -*-
32+##############################################################################
33+#
34+# OpenERP, Open Source Management Solution
35+# This module copyright (C) 2013 Therp BV (<http://therp.nl>).
36+#
37+# This program is free software: you can redistribute it and/or modify
38+# it under the terms of the GNU Affero General Public License as
39+# published by the Free Software Foundation, either version 3 of the
40+# License, or (at your option) any later version.
41+#
42+# This program is distributed in the hope that it will be useful,
43+# but WITHOUT ANY WARRANTY; without even the implied warranty of
44+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
45+# GNU Affero General Public License for more details.
46+#
47+# You should have received a copy of the GNU Affero General Public License
48+# along with this program. If not, see <http://www.gnu.org/licenses/>.
49+#
50+##############################################################################
51+{
52+ "name" : "Window actions for client side paging",
53+ "version" : "1.0",
54+ "author" : "Therp BV",
55+ "complexity": "normal",
56+ "description": """
57+Client side paging
58+=====================
59+
60+This addon enables buttons to return::
61+
62+{'type': 'ir.actions.act_window.page.next'}
63+
64+or::
65+
66+{'type': 'ir.actions.act_window.page.prev'}
67+
68+which trigger the form's controller to page into the requested direction.
69+ """,
70+ "category" : "Dependency",
71+ "depends" : [
72+ ],
73+ "data" : [
74+ ],
75+ "js": [
76+ 'static/src/js/web_ir_actions_act_window_page.js',
77+ ],
78+ "css": [
79+ ],
80+ "qweb": [
81+ ],
82+ "auto_install": False,
83+ "installable": True,
84+ "external_dependencies" : {
85+ 'python' : [],
86+ },
87+}
88
89=== added directory 'web_ir_actions_act_window_page/static'
90=== added directory 'web_ir_actions_act_window_page/static/src'
91=== added directory 'web_ir_actions_act_window_page/static/src/img'
92=== added file 'web_ir_actions_act_window_page/static/src/img/icon.png'
93Binary files web_ir_actions_act_window_page/static/src/img/icon.png 1970-01-01 00:00:00 +0000 and web_ir_actions_act_window_page/static/src/img/icon.png 2013-12-02 14:04:08 +0000 differ
94=== added directory 'web_ir_actions_act_window_page/static/src/js'
95=== added file 'web_ir_actions_act_window_page/static/src/js/web_ir_actions_act_window_page.js'
96--- web_ir_actions_act_window_page/static/src/js/web_ir_actions_act_window_page.js 1970-01-01 00:00:00 +0000
97+++ web_ir_actions_act_window_page/static/src/js/web_ir_actions_act_window_page.js 2013-12-02 14:04:08 +0000
98@@ -0,0 +1,44 @@
99+//-*- coding: utf-8 -*-
100+//############################################################################
101+//
102+// OpenERP, Open Source Management Solution
103+// This module copyright (C) 2013 Therp BV (<http://therp.nl>).
104+//
105+// This program is free software: you can redistribute it and/or modify
106+// it under the terms of the GNU Affero General Public License as
107+// published by the Free Software Foundation, either version 3 of the
108+// License, or (at your option) any later version.
109+//
110+// This program is distributed in the hope that it will be useful,
111+// but WITHOUT ANY WARRANTY; without even the implied warranty of
112+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
113+// GNU Affero General Public License for more details.
114+//
115+// You should have received a copy of the GNU Affero General Public License
116+// along with this program. If not, see <http://www.gnu.org/licenses/>.
117+//
118+//############################################################################
119+
120+openerp.web_ir_actions_act_window_page = function(openerp)
121+{
122+ openerp.web.ActionManager.include({
123+ ir_actions_act_window_page_prev: function(action, options)
124+ {
125+ if(this.inner_widget && this.inner_widget.active_view == 'form' &&
126+ this.inner_widget.views[this.inner_widget.active_view])
127+ {
128+ this.inner_widget.views[this.inner_widget.active_view]
129+ .controller.execute_pager_action('previous');
130+ }
131+ },
132+ ir_actions_act_window_page_next: function(action, options)
133+ {
134+ if(this.inner_widget && this.inner_widget.active_view == 'form' &&
135+ this.inner_widget.views[this.inner_widget.active_view])
136+ {
137+ this.inner_widget.views[this.inner_widget.active_view]
138+ .controller.execute_pager_action('next');
139+ }
140+ },
141+ });
142+}

Subscribers

People subscribed via source and target branches