From e05102d807150813e5d143221cdb958a4e25d3da Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 23 Jun 2025 09:53:09 +0000 Subject: [PATCH] =?UTF-8?q?[IMP]=20stock=5Fusability:=20improve=20quants:?= =?UTF-8?q?=20allow=20groupby=20product=20category=20and=20show=20availabl?= =?UTF-8?q?e=20qt=C3=A9=20in=20tree=20view=20of=20Inventory=20>=20Analysis?= =?UTF-8?q?=20>=20Locations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- stock_usability/models/stock_quant.py | 3 +++ stock_usability/views/stock_quant.xml | 28 ++++++++++++++------------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/stock_usability/models/stock_quant.py b/stock_usability/models/stock_quant.py index 4a8e6b2..a928da9 100644 --- a/stock_usability/models/stock_quant.py +++ b/stock_usability/models/stock_quant.py @@ -10,6 +10,9 @@ class StockQuant(models.Model): product_barcode = fields.Char( related='product_id.barcode', string="Product Barcode") + # product_categ_id is a native related field, but it lacks store=True + # to allow groupby + product_categ_id = fields.Many2one(store=True) def action_stock_move_lines_reserved(self): self.ensure_one() diff --git a/stock_usability/views/stock_quant.xml b/stock_usability/views/stock_quant.xml index 4d784bb..ce98c95 100644 --- a/stock_usability/views/stock_quant.xml +++ b/stock_usability/views/stock_quant.xml @@ -60,6 +60,18 @@ + + + stock.quant + + + +