From 4b2d2577bf7de615ec7bd8c3c52f439c19e3642d Mon Sep 17 00:00:00 2001 From: juan Date: Thu, 22 Oct 2026 13:04:39 +0200 Subject: [PATCH] [IMP] web_widget_sub_view: configurable create-action type and fix overlapping content --- web_widget_sub_view/README.rst | 22 ++++++++++++++-- web_widget_sub_view/__manifest__.py | 1 + web_widget_sub_view/readme/USAGE.md | 8 +++++- .../static/description/index.html | 18 ++++++++++--- .../sub_view_widget/sub_view_widget.esm.js | 4 ++- .../src/sub_view_widget/sub_view_widget.scss | 25 +++++++++++++++++++ 6 files changed, 71 insertions(+), 7 deletions(-) diff --git a/web_widget_sub_view/README.rst b/web_widget_sub_view/README.rst index 23efebb0189..fdf9867730c 100644 --- a/web_widget_sub_view/README.rst +++ b/web_widget_sub_view/README.rst @@ -64,8 +64,18 @@ Also, you can use: - view-type: To force an specific view kind. By default it uses list in desktop and kanban in mobile. -- create-action: To force an specific action for creation (it is a - xmlid) +- create-action: To force an specific action for creation. Depending on + create-action-type, it is either the name of a Python method on the + model, or the id/xmlid of an existing action. +- create-action-type: How create-action should be interpreted: + + - object (default): create-action is a method name on the model, + called server-side. Whatever action it returns (e.g. opening a + wizard) is executed. + - action: create-action is an existing action's id or xmlid (e.g. + ``%(module.action_xmlid)s``), which is loaded and executed directly, + without calling any method. + - open-action: The function to launch to open the record. By default, it uses get_formview_action. - filter: set 0 to hide the filters @@ -110,6 +120,14 @@ 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. +.. |maintainer-etobella| image:: https://github.com/etobella.png?size=40px + :target: https://github.com/etobella + :alt: etobella + +Current `maintainer `__: + +|maintainer-etobella| + 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_widget_sub_view/__manifest__.py b/web_widget_sub_view/__manifest__.py index 3cb0574b422..ab4254ffc76 100644 --- a/web_widget_sub_view/__manifest__.py +++ b/web_widget_sub_view/__manifest__.py @@ -8,6 +8,7 @@ "license": "AGPL-3", "author": "Dixmit,Odoo Community Association (OCA)", "website": "https://github.com/OCA/web", + "maintainers": ["etobella"], "depends": ["web"], "assets": { "web.assets_backend": [ diff --git a/web_widget_sub_view/readme/USAGE.md b/web_widget_sub_view/readme/USAGE.md index 49b6cdc0f42..57fb0782d75 100644 --- a/web_widget_sub_view/readme/USAGE.md +++ b/web_widget_sub_view/readme/USAGE.md @@ -17,7 +17,13 @@ Context is recomended for setting default values and forcing specific views or d Also, you can use: - view-type: To force an specific view kind. By default it uses list in desktop and kanban in mobile. -- create-action: To force an specific action for creation (it is a xmlid) +- create-action: To force an specific action for creation. Depending on create-action-type, it is either + the name of a Python method on the model, or the id/xmlid of an existing action. +- create-action-type: How create-action should be interpreted: + - object (default): create-action is a method name on the model, called server-side. Whatever action + it returns (e.g. opening a wizard) is executed. + - action: create-action is an existing action's id or xmlid (e.g. `%(module.action_xmlid)s`), which is + loaded and executed directly, without calling any method. - open-action: The function to launch to open the record. By default, it uses get_formview_action. - filter: set 0 to hide the filters - group-by: set 0 to hide the group-by diff --git a/web_widget_sub_view/static/description/index.html b/web_widget_sub_view/static/description/index.html index 21d1cbc3081..458913044ee 100644 --- a/web_widget_sub_view/static/description/index.html +++ b/web_widget_sub_view/static/description/index.html @@ -3,7 +3,7 @@ -Web Widget Sub View +README.rst