From d9d174efc643266c24b1eafd2a388b8b91b8ac78 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Mon, 3 Oct 2022 12:31:38 +0000 Subject: [PATCH] [FIX] web: FormViewDialog: add "Remove" button MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the conversion of the FormViewDialog from legacy to wowl, we forgot the feature allowing to display a "Remove" button in the footer, and to execute a custom callback when this button is clicked. This is used for instance by the Gantt view. This commit restores the feature. closes odoo/odoo#102149 X-original-commit: 3eb126d0297a7e3db0cb98cd1ad9555eefaa0cfa Related: odoo/enterprise#32281 Signed-off-by: Géry Debongnie Signed-off-by: Aaron Bohy (aab) --- .../static/src/views/form/form_controller.js | 1 + .../static/src/views/form/form_controller.xml | 3 +++ .../views/view_dialogs/form_view_dialog.js | 7 +++++++ .../view_dialogs/form_view_dialog_tests.js | 20 +++++++++++++++++++ 4 files changed, 31 insertions(+) diff --git a/addons/web/static/src/views/form/form_controller.js b/addons/web/static/src/views/form/form_controller.js index 875aee6fc6b..d42a07ad2a7 100644 --- a/addons/web/static/src/views/form/form_controller.js +++ b/addons/web/static/src/views/form/form_controller.js @@ -473,6 +473,7 @@ FormController.props = { validate: (m) => ["edit", "readonly"].includes(m), }, saveRecord: { type: Function, optional: true }, + removeRecord: { type: Function, optional: true }, Model: Function, Renderer: Function, Compiler: Function, diff --git a/addons/web/static/src/views/form/form_controller.xml b/addons/web/static/src/views/form/form_controller.xml index b3061e51d8b..67cea6c9ffd 100644 --- a/addons/web/static/src/views/form/form_controller.xml +++ b/addons/web/static/src/views/form/form_controller.xml @@ -52,6 +52,9 @@ +