diff --git a/bemade_full_formview_from_modal/static/src/view_dialogs/form_view_dialog.js b/bemade_full_formview_from_modal/static/src/view_dialogs/form_view_dialog.js index 177353f..cfa1f80 100644 --- a/bemade_full_formview_from_modal/static/src/view_dialogs/form_view_dialog.js +++ b/bemade_full_formview_from_modal/static/src/view_dialogs/form_view_dialog.js @@ -3,6 +3,7 @@ import { patch } from "@web/core/utils/patch"; import { useService } from "@web/core/utils/hooks"; import { X2ManyFieldDialog } from "@web/views/fields/relational_utils" +import { FormViewDialog } from "@web/views/view_dialogs/form_view_dialog" patch(X2ManyFieldDialog.prototype, { setup () { @@ -21,3 +22,21 @@ patch(X2ManyFieldDialog.prototype, { }) } }) + +patch(FormViewDialog.prototype, { + setup () { + super.setup(); + this.action = useService('action') + this.env.dialogData.onOpenButtonClicked = this.onOpenButtonClicked.bind(this); + }, + onOpenButtonClicked: function () { + this.action.doAction({ + type: "ir.actions.act_window", + res_model: this.record.resModel, + res_id: this.record.resId, + views: [[false, "form"]], + target: "current", + context: this.props.context, + }) + } +}) diff --git a/bemade_full_formview_from_modal/static/src/view_dialogs/form_view_dialog.xml b/bemade_full_formview_from_modal/static/src/view_dialogs/form_view_dialog.xml index 2e4e55d..294be49 100644 --- a/bemade_full_formview_from_modal/static/src/view_dialogs/form_view_dialog.xml +++ b/bemade_full_formview_from_modal/static/src/view_dialogs/form_view_dialog.xml @@ -5,14 +5,14 @@ - - - - - - - - - - + + + + + + + + + + \ No newline at end of file