From fb1d611243ae1370e72fbf16b2de7950e6431543 Mon Sep 17 00:00:00 2001 From: Chris Mann Date: Mon, 3 Jun 2024 22:30:08 +0100 Subject: [PATCH] [IMP] spreadsheet_oca: Add ability to delete pivots and lists via button --- .../bundle/filter_panel_datasources.esm.js | 20 +++++++++++++++++++ .../src/spreadsheet/bundle/spreadsheet.xml | 6 +++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/spreadsheet_oca/static/src/spreadsheet/bundle/filter_panel_datasources.esm.js b/spreadsheet_oca/static/src/spreadsheet/bundle/filter_panel_datasources.esm.js index 8b5e938..359d955 100644 --- a/spreadsheet_oca/static/src/spreadsheet/bundle/filter_panel_datasources.esm.js +++ b/spreadsheet_oca/static/src/spreadsheet/bundle/filter_panel_datasources.esm.js @@ -119,6 +119,15 @@ export class PivotPanelDisplay extends Component { }); this.env.model.dispatch("REFRESH_PIVOT", {id: this.props.pivotId}); } + deletePivot() { + this.env.askConfirmation( + _t("Are you sure you want to delete this pivot ?"), + () => { + this.env.model.dispatch("REMOVE_PIVOT", {pivotId: this.props.pivotId}); + this.env.openSidePanel("FilterPanel", {}); + } + ); + } } PivotPanelDisplay.template = "spreadsheet_oca.PivotPanelDisplay"; @@ -186,6 +195,17 @@ export class ListPanelDisplay extends Component { domain: new Domain(domain).toList(), }); } + deleteList() { + this.env.askConfirmation( + _t("Are you sure you want to delete this list ?"), + () => { + this.env.model.dispatch("REMOVE_ODOO_LIST", { + listId: this.props.listId, + }); + this.env.openSidePanel("FilterPanel", {}); + } + ); + } } ListPanelDisplay.template = "spreadsheet_oca.ListPanelDisplay"; diff --git a/spreadsheet_oca/static/src/spreadsheet/bundle/spreadsheet.xml b/spreadsheet_oca/static/src/spreadsheet/bundle/spreadsheet.xml index 6200a24..b7ebd97 100644 --- a/spreadsheet_oca/static/src/spreadsheet/bundle/spreadsheet.xml +++ b/spreadsheet_oca/static/src/spreadsheet/bundle/spreadsheet.xml @@ -72,11 +72,12 @@
Last updated at
-
+
+
@@ -113,6 +114,9 @@
Last updated at
+
+ +