diff --git a/web_ir_actions_act_window_page/README.rst b/web_ir_actions_act_window_page/README.rst
index 166357c37..4bd7d2607 100644
--- a/web_ir_actions_act_window_page/README.rst
+++ b/web_ir_actions_act_window_page/README.rst
@@ -7,7 +7,7 @@ Window actions for client side paging
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- !! source digest: sha256:6377a2a15c2f7418c0ffb06a0e658928913944755f511c116abbdc64cce831fd
+ !! source digest: sha256:07dae326aca4830ca73888e3107f5c46bf00000bbc6c5b32be9494b495c21719
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
@@ -17,13 +17,13 @@ Window actions for client side paging
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github
- :target: https://github.com/OCA/web/tree/13.0/web_ir_actions_act_window_page
+ :target: https://github.com/OCA/web/tree/16.0/web_ir_actions_act_window_page
:alt: OCA/web
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
- :target: https://translation.odoo-community.org/projects/web-13-0/web-13-0-web_ir_actions_act_window_page
+ :target: https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_ir_actions_act_window_page
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
- :target: https://runboat.odoo-community.org/builds?repo=OCA/web&target_branch=13.0
+ :target: https://runboat.odoo-community.org/builds?repo=OCA/web&target_branch=16.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -61,7 +61,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues `_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
-`feedback `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -93,6 +93,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
-This module is part of the `OCA/web `_ project on GitHub.
+This module is part of the `OCA/web `_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/web_ir_actions_act_window_page/__init__.py b/web_ir_actions_act_window_page/__init__.py
index 1cb6c52ec..784f5c8cf 100644
--- a/web_ir_actions_act_window_page/__init__.py
+++ b/web_ir_actions_act_window_page/__init__.py
@@ -1,19 +1,3 @@
-##############################################################################
-#
-# 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 .
-#
-##############################################################################
+# Copyright 2023 Hunki Enterprises BV
+# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
+from . import models
diff --git a/web_ir_actions_act_window_page/__manifest__.py b/web_ir_actions_act_window_page/__manifest__.py
index a4586f9e2..0a6046887 100644
--- a/web_ir_actions_act_window_page/__manifest__.py
+++ b/web_ir_actions_act_window_page/__manifest__.py
@@ -7,10 +7,14 @@
"or next next record in the form view"
),
"author": "Hunki Enterprises BV, Therp BV,Odoo Community Association (OCA)",
- "version": "13.0.1.0.0",
+ "version": "16.0.1.0.0",
"category": "Technical",
"depends": ["web"],
- "data": ["views/assets.xml"],
+ "assets": {
+ "web.assets_backend": [
+ "web_ir_actions_act_window_page/static/src/web_ir_actions_act_window_page.esm.js",
+ ]
+ },
"demo": ["demo/demo_action.xml"],
"installable": True,
"license": "AGPL-3",
diff --git a/web_ir_actions_act_window_page/models/__init__.py b/web_ir_actions_act_window_page/models/__init__.py
new file mode 100644
index 000000000..60d068165
--- /dev/null
+++ b/web_ir_actions_act_window_page/models/__init__.py
@@ -0,0 +1,3 @@
+# Copyright 2023 Hunki Enterprises BV
+# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
+from . import ir_actions_act_window_page
diff --git a/web_ir_actions_act_window_page/models/ir_actions_act_window_page.py b/web_ir_actions_act_window_page/models/ir_actions_act_window_page.py
new file mode 100644
index 000000000..107b6569a
--- /dev/null
+++ b/web_ir_actions_act_window_page/models/ir_actions_act_window_page.py
@@ -0,0 +1,27 @@
+# Copyright 2023 Hunki Enterprises BV
+# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
+from odoo import models
+
+
+class IrActionsActWindowPagePrev(models.AbstractModel):
+ _name = "ir.actions.act_window.page.prev"
+ _description = "Action to page to the previous record from a form view button"
+
+ def _get_readable_fields(self):
+ return set() # pragma: no cover
+
+
+class IrActionsActWindowPageNext(models.AbstractModel):
+ _name = "ir.actions.act_window.page.next"
+ _description = "Action to page to the next record from a form view button"
+
+ def _get_readable_fields(self):
+ return set() # pragma: no cover
+
+
+class IrActionsActWindowPageList(models.AbstractModel):
+ _name = "ir.actions.act_window.page.list"
+ _description = "Action to switch to the list view"
+
+ def _get_readable_fields(self):
+ return set() # pragma: no cover
diff --git a/web_ir_actions_act_window_page/static/description/index.html b/web_ir_actions_act_window_page/static/description/index.html
index f109ad811..e2f206671 100644
--- a/web_ir_actions_act_window_page/static/description/index.html
+++ b/web_ir_actions_act_window_page/static/description/index.html
@@ -367,9 +367,9 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!! source digest: sha256:6377a2a15c2f7418c0ffb06a0e658928913944755f511c116abbdc64cce831fd
+!! source digest: sha256:07dae326aca4830ca73888e3107f5c46bf00000bbc6c5b32be9494b495c21719
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-

+

This addon allows a developer to return the following action types:
{'type': 'ir.actions.act_window.page.next'}
@@ -407,7 +407,7 @@ to the partner form view.
Bugs are tracked on GitHub Issues.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
-feedback.
+feedback.
Do not contact contributors directly about support or help with technical issues.
@@ -433,7 +433,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
-
This module is part of the OCA/web project on GitHub.
+
This module is part of the OCA/web project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
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
deleted file mode 100644
index d4950207c..000000000
--- a/web_ir_actions_act_window_page/static/src/js/web_ir_actions_act_window_page.js
+++ /dev/null
@@ -1,38 +0,0 @@
-// Coding: utf-8
-// (c) 2013-2015 Therp BV ()
-// (c) 2023 Hunki Enterprises BV ()
-// License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
-odoo.define("web.ir_actions_act_window_page", function(require) {
- "use strict";
- var ActionManager = require("web.ActionManager");
- ActionManager.include({
- _handleAction: function(action, options) {
- if (action.type === "ir.actions.act_window.page.prev") {
- return this._executeWindowActionPage(action, options, -1);
- }
- if (action.type === "ir.actions.act_window.page.next") {
- return this._executeWindowActionPage(action, options, 1);
- }
- return this._super.apply(this, arguments);
- },
- _executeWindowActionPage: function(action, options, direction) {
- const controller = this.getCurrentController();
- if (controller && controller.widget && controller.widget.pager) {
- if (
- this.controllerStack.length > 1 &&
- controller.widget.pager.state.size === 0
- ) {
- // If whatever happened in the button action made the last record inaccessible
- // switch back to the tree view
- return this._restoreController(this.controllerStack.at(-2));
- }
- controller.widget.pager[direction > 0 ? "next" : "previous"]();
- }
- if (options && options.on_close && options.on_close.name !== "reload") {
- // Suppress reloads as the pager does it
- options.on_close();
- }
- return Promise.resolve();
- },
- });
-});
diff --git a/web_ir_actions_act_window_page/static/src/web_ir_actions_act_window_page.esm.js b/web_ir_actions_act_window_page/static/src/web_ir_actions_act_window_page.esm.js
new file mode 100644
index 000000000..48d67ace3
--- /dev/null
+++ b/web_ir_actions_act_window_page/static/src/web_ir_actions_act_window_page.esm.js
@@ -0,0 +1,40 @@
+/** @odoo-module **/
+// (c) 2013-2015 Therp BV ()
+// (c) 2023 Hunki Enterprises BV ()
+// License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
+
+import {Pager} from "@web/core/pager/pager";
+import {patch} from "@web/core/utils/patch";
+import {registry} from "@web/core/registry";
+import {useBus} from "@web/core/utils/hooks";
+
+const actionHandlersRegistry = registry.category("action_handlers");
+
+async function executeWindowActionPage({env}, direction) {
+ return env.bus.trigger("pager:navigate", {direction});
+}
+
+async function executeWindowActionList({env}) {
+ return env.services.action.switchView("list");
+}
+
+actionHandlersRegistry.add("ir.actions.act_window.page.prev", async (params) =>
+ executeWindowActionPage(params, -1)
+);
+actionHandlersRegistry.add("ir.actions.act_window.page.next", async (params) =>
+ executeWindowActionPage(params, 1)
+);
+actionHandlersRegistry.add("ir.actions.act_window.page.list", async (params) =>
+ executeWindowActionList(params)
+);
+
+patch(Pager.prototype, "navigate event listener", {
+ setup() {
+ this._super.apply();
+ const handleNavigate = (ev) => this._handleNavigate(ev);
+ useBus(this.env.bus, "pager:navigate", handleNavigate);
+ },
+ _handleNavigate(ev) {
+ return this.navigate(ev.detail.direction);
+ },
+});
diff --git a/web_ir_actions_act_window_page/views/assets.xml b/web_ir_actions_act_window_page/views/assets.xml
deleted file mode 100644
index 0febb1e93..000000000
--- a/web_ir_actions_act_window_page/views/assets.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-