Skip to content

Commit a7843d6

Browse files
[MIG][10.0] web_ir_actions_act_window_page
1 parent ef61526 commit a7843d6

5 files changed

Lines changed: 91 additions & 70 deletions

File tree

web_ir_actions_act_window_page/README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
2+
:target: https://www.gnu.org/licenses/agpl
3+
:alt: License: AGPL-3
4+
5+
==================
16
Client side paging
27
==================
38

@@ -11,3 +16,51 @@ or::
1116

1217
which trigger the form's controller to page into the requested direction on the
1318
client side.
19+
20+
A use case could be the case of a validation flow. As a developer, you set up a tree view with a domain on records to be validated. The user opens the first record in a form view and validates the record. The validation method returns the 'next' action type so that the browser window of the user is presented with the next record in the form view.
21+
22+
Usage
23+
=====
24+
25+
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
26+
:alt: Try me on Runbot
27+
:target: https://runbot.odoo-community.org/runbot/162/10.0
28+
29+
Bug Tracker
30+
===========
31+
32+
Bugs are tracked on `GitHub Issues
33+
<https://github.com/OCA/web/issues>`_. In case of trouble, please
34+
check there if your issue has already been reported. If you spotted it first,
35+
help us smash it by providing detailed and welcomed feedback.
36+
37+
Credits
38+
=======
39+
40+
Images
41+
------
42+
43+
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
44+
45+
Contributors
46+
------------
47+
48+
* Holger Brunn <hbrunn@therp.nl>
49+
* Stefan Rijnhart <stefan@opener.amsterdam>
50+
51+
Do not contact contributors directly about support or help with technical issues.
52+
53+
Maintainer
54+
----------
55+
56+
.. image:: https://odoo-community.org/logo.png
57+
:alt: Odoo Community Association
58+
:target: https://odoo-community.org
59+
60+
This module is maintained by the OCA.
61+
62+
OCA, or the Odoo Community Association, is a nonprofit organization whose
63+
mission is to support the collaborative development of Odoo features and
64+
promote its widespread use.
65+
66+
To contribute to this module, please visit https://odoo-community.org.
Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,20 @@
1-
# -*- coding: utf-8 -*-
2-
##############################################################################
3-
#
4-
# OpenERP, Open Source Management Solution
5-
# This module copyright (C) 2013-2015 Therp BV (<http://therp.nl>).
6-
#
7-
# This program is free software: you can redistribute it and/or modify
8-
# it under the terms of the GNU Affero General Public License as
9-
# published by the Free Software Foundation, either version 3 of the
10-
# License, or (at your option) any later version.
11-
#
12-
# This program is distributed in the hope that it will be useful,
13-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15-
# GNU Affero General Public License for more details.
16-
#
17-
# You should have received a copy of the GNU Affero General Public License
18-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
19-
#
20-
##############################################################################
1+
# coding: utf-8
2+
# © 2013-2015 Therp BV (<http://therp.nl>)
3+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
214
{
225
"name": "Window actions for client side paging",
236
"summary": ("Allows a developer to trigger a pager to show the previous "
247
"or next next record in the form view"),
25-
"version": "8.0.1.0.0",
268
"author": "Therp BV,Odoo Community Association (OCA)",
27-
"category": "Dependency",
28-
"depends": ['web'],
29-
'data': ['view/qweb.xml'],
30-
'installable': False,
9+
"version": "10.0.1.0.0",
10+
"category": "Technical",
11+
"depends": [
12+
'web',
13+
],
14+
'data': [
15+
'views/assets.xml',
16+
],
17+
'installable': True,
18+
'license': 'AGPL-3',
19+
'url': 'https://github.com/oca/web',
3120
}
Lines changed: 13 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,16 @@
1-
//-*- coding: utf-8 -*-
2-
//############################################################################
3-
//
4-
// OpenERP, Open Source Management Solution
5-
// This module copyright (C) 2013-2015 Therp BV (<http://therp.nl>).
6-
//
7-
// This program is free software: you can redistribute it and/or modify
8-
// it under the terms of the GNU Affero General Public License as
9-
// published by the Free Software Foundation, either version 3 of the
10-
// License, or (at your option) any later version.
11-
//
12-
// This program is distributed in the hope that it will be useful,
13-
// but WITHOUT ANY WARRANTY; without even the implied warranty of
14-
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15-
// GNU Affero General Public License for more details.
16-
//
17-
// You should have received a copy of the GNU Affero General Public License
18-
// along with this program. If not, see <http://www.gnu.org/licenses/>.
19-
//
20-
//############################################################################
1+
// coding: utf-8
2+
// © 2013-2015 Therp BV (<http://therp.nl>)
3+
// License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
4+
odoo.define('web.ir_actions_act_window_page', function(require) {
215

22-
openerp.web_ir_actions_act_window_page = function(instance)
23-
{
24-
instance.web.ActionManager.include({
6+
var ActionManager = require('web.ActionManager');
7+
ActionManager.include({
258
ir_actions_act_window_page_prev: function(action, options)
269
{
27-
if(this.inner_widget && this.inner_widget.active_view == 'form' &&
28-
this.inner_widget.views[this.inner_widget.active_view])
10+
if(this.inner_widget && this.inner_widget.active_view.type == 'form' &&
11+
this.inner_widget.active_view)
2912
{
30-
this.inner_widget.views[this.inner_widget.active_view]
31-
.controller.execute_pager_action('previous');
13+
this.inner_widget.active_view.controller.pager.previous();
3214
}
3315
if(options && options.on_close)
3416
{
@@ -37,16 +19,15 @@ openerp.web_ir_actions_act_window_page = function(instance)
3719
},
3820
ir_actions_act_window_page_next: function(action, options)
3921
{
40-
if(this.inner_widget && this.inner_widget.active_view == 'form' &&
41-
this.inner_widget.views[this.inner_widget.active_view])
22+
if(this.inner_widget && this.inner_widget.active_view.type == 'form' &&
23+
this.inner_widget.active_view)
4224
{
43-
this.inner_widget.views[this.inner_widget.active_view]
44-
.controller.execute_pager_action('next');
25+
this.inner_widget.active_view.controller.pager.next();
4526
}
4627
if(options && options.on_close)
4728
{
4829
options.on_close();
4930
}
5031
},
5132
});
52-
}
33+
});

web_ir_actions_act_window_page/view/qweb.xml

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<odoo>
3+
<template id="assets_backend"
4+
name="web_ir_actions_act_window_page assets"
5+
inherit_id="web.assets_backend">
6+
<xpath expr="." position="inside">
7+
<script type="text/javascript"
8+
src="/web_ir_actions_act_window_page/static/src/js/web_ir_actions_act_window_page.js"></script>
9+
</xpath>
10+
</template>
11+
</odoo>

0 commit comments

Comments
 (0)