From 3aa8c6a5fa89e6f28361668074b8242d93bdfbd9 Mon Sep 17 00:00:00 2001 From: Lois Rilo Date: Thu, 16 Mar 2023 11:12:39 +0100 Subject: [PATCH 1/2] [IMP] stock_demand_estimate: enhance views * Add a graph view. * Add handy filters: (not) expired; group by date, location and/or product. * Relabel `product_qty` as "Real Quantity" was really confusing. --- .../models/stock_demand_estimate.py | 2 +- .../views/stock_demand_estimate_view.xml | 48 ++++++++++++++++++- 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/stock_demand_estimate/models/stock_demand_estimate.py b/stock_demand_estimate/models/stock_demand_estimate.py index 5f0af2d58..b7b056bb2 100644 --- a/stock_demand_estimate/models/stock_demand_estimate.py +++ b/stock_demand_estimate/models/stock_demand_estimate.py @@ -33,7 +33,7 @@ class StockDemandEstimate(models.Model): ) product_uom_qty = fields.Float(string="Quantity", digits="Product Unit of Measure") product_qty = fields.Float( - "Real Quantity", + string="Quantity (Product UoM)", compute="_compute_product_quantity", inverse="_inverse_product_quantity", digits=0, diff --git a/stock_demand_estimate/views/stock_demand_estimate_view.xml b/stock_demand_estimate/views/stock_demand_estimate_view.xml index b9b01334b..c5d543886 100644 --- a/stock_demand_estimate/views/stock_demand_estimate_view.xml +++ b/stock_demand_estimate/views/stock_demand_estimate_view.xml @@ -56,6 +56,19 @@ + + + stock.demand.estimate.graph + stock.demand.estimate + + + + + + + + + stock.demand.estimate.search stock.demand.estimate @@ -63,6 +76,38 @@ + + + + + + + + + @@ -70,8 +115,9 @@ Stock Demand Estimates ir.actions.act_window stock.demand.estimate - tree,form,pivot + tree,form,pivot,graph + {"search_default_not_expired": 1} Date: Thu, 16 Mar 2023 17:55:48 +0100 Subject: [PATCH 2/2] [FIX] stock_demand_estimate_matrix: remove action extension no need to modify action, once the tree view is set as editable it will work as itended, no need to remove form from the view modes. --- .../views/stock_demand_estimate_view.xml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/stock_demand_estimate_matrix/views/stock_demand_estimate_view.xml b/stock_demand_estimate_matrix/views/stock_demand_estimate_view.xml index d74cad674..4dc5d10f7 100644 --- a/stock_demand_estimate_matrix/views/stock_demand_estimate_view.xml +++ b/stock_demand_estimate_matrix/views/stock_demand_estimate_view.xml @@ -43,10 +43,5 @@ - - tree,pivot - +