-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate web_ir_actions_act_view_reload to 15.0
- Loading branch information
Showing
9 changed files
with
50 additions
and
60 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
setup/web_ir_actions_act_view_reload/odoo/addons/web_ir_actions_act_view_reload
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../web_ir_actions_act_view_reload |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import setuptools | ||
|
||
setuptools.setup( | ||
setup_requires=['setuptools-odoo'], | ||
odoo_addon=True, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import ir_actions_act_view_reload |
7 changes: 7 additions & 0 deletions
7
web_ir_actions_act_view_reload/models/ir_actions_act_view_reload.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from odoo import models | ||
|
||
|
||
class IrActionsActViewReload(models.Model): | ||
_name = "ir.actions.act_view_reload" | ||
_inherit = "ir.actions.actions" | ||
_description = "View Reload" |
27 changes: 27 additions & 0 deletions
27
web_ir_actions_act_view_reload/static/src/js/web_ir_actions_act_view_reload.esm.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** @odoo-module **/ | ||
// Copyright 2017 - 2018 Modoolar <[email protected]> | ||
// Copyright 2018 Modoolar <[email protected]> | ||
// License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). | ||
|
||
import {registry} from "@web/core/registry"; | ||
const actionHandlersRegistry = registry.category("action_handlers"); | ||
|
||
function ir_actions_act_view_reload(args) { | ||
// Odoo v15 is running in "legacy" mode - some of the JS | ||
// is written in Owl, some is still legacy (e.g. controllers | ||
// are still written in the old system - hence below hack) | ||
|
||
//TODO: for Odoo v16, this will probably need to be re-written in Owl | ||
//REF: https://github.com/odoo/odoo/blob/7054fd6beb4f417efa4b22aafe8b935dd6ade123/addons/web/static/src/webclient/actions/action_service.js#L1257-L1267 | ||
|
||
const controller = args.env.services.action.currentController; | ||
if (controller) { | ||
const {__legacy_widget__} = controller.getLocalState(); | ||
if (__legacy_widget__) { | ||
__legacy_widget__.reload({}); | ||
} | ||
} | ||
return Promise.resolve(); | ||
} | ||
|
||
actionHandlersRegistry.add("ir.actions.act_view_reload", ir_actions_act_view_reload); |
37 changes: 0 additions & 37 deletions
37
web_ir_actions_act_view_reload/static/src/js/web_ir_actions_act_view_reload.js
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
web_ir_actions_act_view_reload/views/web_ir_actions_act_view_reload.xml
This file was deleted.
Oops, something went wrong.