From 9999fe649e0ecbae2e115403b7b86967691e0e00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lef=C3=A8vre?= Date: Thu, 12 Jan 2023 09:07:24 +0000 Subject: [PATCH] [FIX] spreadsheet_dashboard_*: exlude drafts and cancelled records Some amounts were wrong because quotations were included, even though they do not make revenue. opw 3121450 task 3130829 X-original-commit: 0fa2510c34a41e9e91131909a0b24af25aa770fc Part-of: odoo/odoo#111137 --- .../data/files/pos_dashboard.json | 14 +-- .../data/files/product_dashboard.json | 48 +++++++++-- .../data/files/sales_dashboard.json | 86 ++++++++++++++++++- .../data/files/elearning_dashboard.json | 16 ++++ 4 files changed, 147 insertions(+), 17 deletions(-) diff --git a/addons/spreadsheet_dashboard_pos_hr/data/files/pos_dashboard.json b/addons/spreadsheet_dashboard_pos_hr/data/files/pos_dashboard.json index cc25cbe6c0b..154daa0f3c6 100644 --- a/addons/spreadsheet_dashboard_pos_hr/data/files/pos_dashboard.json +++ b/addons/spreadsheet_dashboard_pos_hr/data/files/pos_dashboard.json @@ -1099,7 +1099,7 @@ "group_by_no_leaf": 1, "group_by": [] }, - "domain": [], + "domain": [["state", "in", ["paid", "done", "invoiced"]]], "groupBy": [ "date:month" ], @@ -1298,7 +1298,7 @@ "amount_total", "state" ], - "domain": [], + "domain": [["state", "in", ["paid", "done", "invoiced"]]], "model": "pos.order", "context": {}, "orderBy": [ @@ -1319,7 +1319,7 @@ "group_by_no_leaf": 1, "group_by": [] }, - "domain": [], + "domain": [["state", "in", ["paid", "done", "invoiced"]]], "id": "1", "measures": [ { @@ -1349,7 +1349,7 @@ "group_by_no_leaf": 1, "group_by": [] }, - "domain": [], + "domain": [["state", "in", ["paid", "done", "invoiced"]]], "id": "2", "measures": [ { @@ -1380,6 +1380,7 @@ "group_by": [] }, "domain": [ + ["state", "in", ["paid", "done", "invoiced"]], [ "user_id", "!=", @@ -1416,6 +1417,7 @@ "group_by": [] }, "domain": [ + ["state", "in", ["paid", "done", "invoiced"]], [ "product_id", "!=", @@ -1451,7 +1453,7 @@ "group_by_no_leaf": 1, "group_by": [] }, - "domain": [], + "domain": [["state", "in", ["paid", "done", "invoiced"]]], "id": "5", "measures": [ { @@ -1472,7 +1474,7 @@ "group_by_no_leaf": 1, "group_by": [] }, - "domain": [], + "domain": [["state", "in", ["paid", "done", "invoiced"]]], "id": "6", "measures": [ { diff --git a/addons/spreadsheet_dashboard_sale/data/files/product_dashboard.json b/addons/spreadsheet_dashboard_sale/data/files/product_dashboard.json index 4da692c00da..cd667795e1a 100644 --- a/addons/spreadsheet_dashboard_sale/data/files/product_dashboard.json +++ b/addons/spreadsheet_dashboard_sale/data/files/product_dashboard.json @@ -47,17 +47,17 @@ "cells": { "A7": { "style": 1, - "content": "[Best Sellers by Revenue](odoo://view/{\"viewType\":\"graph\",\"action\":{\"domain\":[],\"context\":{\"group_by\":[\"product_id\"],\"graph_measure\":\"price_subtotal\",\"graph_mode\":\"bar\",\"graph_groupbys\":[\"product_id\"]},\"modelName\":\"sale.report\",\"views\":[[false,\"graph\"],[false,\"pivot\"],[false,\"search\"]]},\"threshold\":0,\"name\":\"Best Sellers by Revenue\"})", + "content": "[Best Sellers by Revenue](odoo://view/{\"viewType\":\"graph\",\"action\":{\"domain\":[[\"state\", \"not in\", [\"draft\", \"sent\", \"cancel\"]]],\"context\":{\"group_by\":[\"product_id\"],\"graph_measure\":\"price_subtotal\",\"graph_mode\":\"bar\",\"graph_groupbys\":[\"product_id\"]},\"modelName\":\"sale.report\",\"views\":[[false,\"graph\"],[false,\"pivot\"],[false,\"search\"]]},\"threshold\":0,\"name\":\"Best Sellers by Revenue\"})", "border": 1 }, "A24": { "style": 1, - "content": "[Best Sellers by Units Sold](odoo://view/{\"viewType\":\"graph\",\"action\":{\"domain\":[],\"context\":{\"group_by\":[\"product_id\"],\"graph_measure\":\"__count\",\"graph_mode\":\"bar\",\"graph_groupbys\":[\"product_id\"]},\"modelName\":\"sale.report\",\"views\":[[false,\"graph\"],[false,\"pivot\"],[false,\"search\"]]},\"threshold\":0,\"name\":\"Sales Analysis\"})", + "content": "[Best Sellers by Units Sold](odoo://view/{\"viewType\":\"graph\",\"action\":{\"domain\":[[\"state\", \"not in\", [\"draft\", \"sent\", \"cancel\"]]],\"context\":{\"group_by\":[\"product_id\"],\"graph_measure\":\"__count\",\"graph_mode\":\"bar\",\"graph_groupbys\":[\"product_id\"]},\"modelName\":\"sale.report\",\"views\":[[false,\"graph\"],[false,\"pivot\"],[false,\"search\"]]},\"threshold\":0,\"name\":\"Sales Analysis\"})", "border": 1 }, "A41": { "style": 1, - "content": "[Best Selling Products](odoo://view/{\"viewType\":\"pivot\",\"action\":{\"domain\":[],\"context\":{\"group_by\":[\"product_id\"],\"pivot_measures\":[\"__count\",\"price_subtotal\"],\"pivot_column_groupby\":[],\"pivot_row_groupby\":[\"product_id\"]},\"modelName\":\"sale.report\",\"views\":[[false,\"graph\"],[false,\"pivot\"],[false,\"search\"]]},\"threshold\":0,\"name\":\"Sales Analysis\"})", + "content": "[Best Selling Products](odoo://view/{\"viewType\":\"pivot\",\"action\":{\"domain\":[[\"state\", \"not in\", [\"draft\", \"sent\", \"cancel\"]]],\"context\":{\"group_by\":[\"product_id\"],\"pivot_measures\":[\"__count\",\"price_subtotal\"],\"pivot_column_groupby\":[],\"pivot_row_groupby\":[\"product_id\"]},\"modelName\":\"sale.report\",\"views\":[[false,\"graph\"],[false,\"pivot\"],[false,\"search\"]]},\"threshold\":0,\"name\":\"Sales Analysis\"})", "border": 1 }, "A42": { @@ -201,7 +201,7 @@ }, "E41": { "style": 1, - "content": "[Best Selling Categories](odoo://view/{\"viewType\":\"pivot\",\"action\":{\"domain\":[],\"context\":{\"group_by\":[\"categ_id\"],\"pivot_measures\":[\"__count\",\"price_subtotal\"],\"pivot_column_groupby\":[],\"pivot_row_groupby\":[\"categ_id\"]},\"modelName\":\"sale.report\",\"views\":[[false,\"graph\"],[false,\"pivot\"],[false,\"search\"]]},\"threshold\":0,\"name\":\"Sales Analysis\"})", + "content": "[Best Selling Categories](odoo://view/{\"viewType\":\"pivot\",\"action\":{\"domain\":[[\"state\", \"not in\", [\"draft\", \"sent\", \"cancel\"]]],\"context\":{\"group_by\":[\"categ_id\"],\"pivot_measures\":[\"__count\",\"price_subtotal\"],\"pivot_column_groupby\":[],\"pivot_row_groupby\":[\"categ_id\"]},\"modelName\":\"sale.report\",\"views\":[[false,\"graph\"],[false,\"pivot\"],[false,\"search\"]]},\"threshold\":0,\"name\":\"Sales Analysis\"})", "border": 1 }, "E42": { @@ -464,7 +464,15 @@ "group_by_no_leaf": 1, "group_by": [] }, - "domain": [], + "domain": [[ + "state", + "not in", + [ + "draft", + "sent", + "cancel" + ] + ]], "groupBy": [ "product_id" ], @@ -500,7 +508,15 @@ "group_by_no_leaf": 1, "group_by": [] }, - "domain": [], + "domain": [[ + "state", + "not in", + [ + "draft", + "sent", + "cancel" + ] + ]], "groupBy": [ "product_id" ], @@ -690,7 +706,15 @@ "group_by_no_leaf": 1, "group_by": [] }, - "domain": [], + "domain": [[ + "state", + "not in", + [ + "draft", + "sent", + "cancel" + ] + ]], "id": "1", "measures": [ { @@ -723,7 +747,15 @@ "group_by_no_leaf": 1, "group_by": [] }, - "domain": [], + "domain": [[ + "state", + "not in", + [ + "draft", + "sent", + "cancel" + ] + ]], "id": "2", "measures": [ { diff --git a/addons/spreadsheet_dashboard_sale/data/files/sales_dashboard.json b/addons/spreadsheet_dashboard_sale/data/files/sales_dashboard.json index 19fe9fd0b0f..9fe642536ee 100644 --- a/addons/spreadsheet_dashboard_sale/data/files/sales_dashboard.json +++ b/addons/spreadsheet_dashboard_sale/data/files/sales_dashboard.json @@ -2406,7 +2406,7 @@ }, "revisionId": "START_REVISION", "chartOdooMenusReferences": { - "a527960b-0812-4291-baba-f6b4b5280a0d": "sale.sale_menu_root", + "a527960b-0812-4291-baba-f6b4b5280a0d": "sale.menu_sale_order", "51823220-f22b-4359-8711-579a249c91bb": "sale.menu_sale_quotations", "9a38934c-b454-4a4b-88aa-17d1b80dbf5f": "sale.menu_sale_order", "67858d0e-b5ba-4a3c-bf9e-c0fceaeedf65": "sale.menu_sale_report", @@ -2499,6 +2499,14 @@ "categ_id", "!=", false + ], [ + "state", + "not in", + [ + "draft", + "sent", + "cancel" + ] ] ], "id": "3", @@ -2542,6 +2550,14 @@ "partner_id", "!=", false + ], [ + "state", + "not in", + [ + "draft", + "sent", + "cancel" + ] ] ], "id": "4", @@ -2585,6 +2601,14 @@ "country_id", "!=", false + ], [ + "state", + "not in", + [ + "draft", + "sent", + "cancel" + ] ] ], "id": "5", @@ -2628,6 +2652,14 @@ "product_tmpl_id", "!=", false + ], [ + "state", + "not in", + [ + "draft", + "sent", + "cancel" + ] ] ], "id": "6", @@ -2664,6 +2696,14 @@ "team_id", "!=", false + ], [ + "state", + "not in", + [ + "draft", + "sent", + "cancel" + ] ] ], "id": "7", @@ -2700,6 +2740,14 @@ "user_id", "!=", false + ], [ + "state", + "not in", + [ + "draft", + "sent", + "cancel" + ] ] ], "id": "8", @@ -2736,6 +2784,14 @@ "source_id", "!=", false + ], [ + "state", + "not in", + [ + "draft", + "sent", + "cancel" + ] ] ], "id": "9", @@ -2772,6 +2828,14 @@ "medium_id", "!=", false + ], [ + "state", + "not in", + [ + "draft", + "sent", + "cancel" + ] ] ], "id": "10", @@ -2800,7 +2864,15 @@ "11": { "colGroupBys": [], "context": {}, - "domain": [], + "domain": [[ + "state", + "not in", + [ + "draft", + "sent", + "cancel" + ] + ]], "id": "11", "measures": [ { @@ -2820,7 +2892,15 @@ "12": { "colGroupBys": [], "context": {}, - "domain": [], + "domain": [[ + "state", + "not in", + [ + "draft", + "sent", + "cancel" + ] + ]], "id": "12", "measures": [ { diff --git a/addons/spreadsheet_dashboard_website_sale_slides/data/files/elearning_dashboard.json b/addons/spreadsheet_dashboard_website_sale_slides/data/files/elearning_dashboard.json index dfb8e823bb5..6355f32e127 100644 --- a/addons/spreadsheet_dashboard_website_sale_slides/data/files/elearning_dashboard.json +++ b/addons/spreadsheet_dashboard_website_sale_slides/data/files/elearning_dashboard.json @@ -753,6 +753,14 @@ "product_id.channel_ids", "!=", false + ], [ + "state", + "not in", + [ + "draft", + "sent", + "cancel" + ] ] ], "id": "10", @@ -782,6 +790,14 @@ "product_id.channel_ids", "!=", false + ], [ + "state", + "not in", + [ + "draft", + "sent", + "cancel" + ] ] ], "id": "11",