Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions web_widget_sub_view/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion web_widget_sub_view/readme/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 13 additions & 3 deletions web_widget_sub_view/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>Web Widget Sub View</title>
<title>README.rst</title>
<style type="text/css">

/*
Expand Down Expand Up @@ -408,8 +408,18 @@ <h2><a class="toc-backref" href="#toc-entry-1">Usage</a></h2>
<ul class="simple">
<li>view-type: To force an specific view kind. By default it uses list in
desktop and kanban in mobile.</li>
<li>create-action: To force an specific action for creation (it is a
xmlid)</li>
<li>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.</li>
<li>create-action-type: How create-action should be interpreted:<ul>
<li>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.</li>
<li>action: create-action is an existing action’s id or xmlid (e.g.
<tt class="docutils literal">%(module.action_xmlid)s</tt>), which is loaded and executed directly,
without calling any method.</li>
</ul>
</li>
<li>open-action: The function to launch to open the record. By default, it
uses get_formview_action.</li>
<li>filter: set 0 to hide the filters</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class SubViewWidget extends Component {
if (this.props.createAction) {
this.action.doActionButton({
name: this.props.createAction,
type: "action",
type: this.props.createActionType,
resModel: this.props.record.resModel,
resId: this.props.record.resId,
resIds: this.props.record.resIds,
Expand Down Expand Up @@ -108,6 +108,7 @@ SubViewWidget.props = {
resModel: String,
recordAction: String,
createAction: {type: String, optional: true},
createActionType: {type: String, optional: true},
context: String,
domain: String,
ViewType: {type: String, optional: true},
Expand All @@ -125,6 +126,7 @@ SubViewWidget.extractProps = ({attrs}) => {
context: attrs.context || "{}",
recordAction: attrs["open-action"] || "get_formview_action",
createAction: attrs["create-action"],
createActionType: attrs["create-action-type"] || "object",
domain: attrs.domain || "[]",
ViewType: attrs["view-type"],
filter: Boolean(JSON.parse(attrs.filter || "1")),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,28 @@
> :first-child:not(.o_group).o_widget_sub_view_widget {
@include o-form-sheet-negative-margin;
}

.o_notebook.vertical
.o_notebook_content
> .tab-pane
> :first-child:not(.o_group).o_widget_sub_view_widget {
margin-left: 0;
margin-right: 0;
}

.o_widget_sub_view_widget {
position: relative;

// !important: the rules being overridden are nested under `html .o_web_client`,
// which outranks this selector's specificity regardless of source order.
.o_content {
position: static !important;
height: auto !important;
overflow: visible !important;

> .o_view_controller {
position: static !important;
height: auto !important;
}
}
}
Loading