From 9eb077794b0722e7d27cc4a5224f6a064c24b04e Mon Sep 17 00:00:00 2001 From: alfredoavanzosc Date: Mon, 27 Jan 2020 12:13:55 +0100 Subject: [PATCH] [IMP] stock_quant_reservation_status: In stock quant object, put field "reserved_for" to store=True, for group by this field. --- stock_quant_reservation_status/__openerp__.py | 2 +- stock_quant_reservation_status/models/stock.py | 5 +++-- stock_quant_reservation_status/views/stock_view.xml | 6 ++++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/stock_quant_reservation_status/__openerp__.py b/stock_quant_reservation_status/__openerp__.py index 0cd002d..272d970 100644 --- a/stock_quant_reservation_status/__openerp__.py +++ b/stock_quant_reservation_status/__openerp__.py @@ -18,7 +18,7 @@ { "name": "Stock - Quants reservation status", - "version": "8.0.1.0.0", + "version": "8.0.1.1.0", "depends": [ "stock", ], diff --git a/stock_quant_reservation_status/models/stock.py b/stock_quant_reservation_status/models/stock.py index 3176cbc..7fc1f8e 100644 --- a/stock_quant_reservation_status/models/stock.py +++ b/stock_quant_reservation_status/models/stock.py @@ -10,7 +10,8 @@ class StockQuant(models.Model): _inherit = 'stock.quant' @api.one - @api.depends('reservation_id') + @api.depends('reservation_id', 'reservation_id.origin', + 'reservation_id.picking_id', 'reservation_id.picking_id.name') def _is_reserved(self): self.is_reserved = bool(self.reservation_id) self.reserved_for = ( @@ -20,4 +21,4 @@ def _is_reserved(self): is_reserved = fields.Boolean( string='Reserved Quant', compute='_is_reserved', store=True) reserved_for = fields.Char( - string='Reserved for', compute='_is_reserved') + string='Reserved for', compute='_is_reserved', store=True) diff --git a/stock_quant_reservation_status/views/stock_view.xml b/stock_quant_reservation_status/views/stock_view.xml index 5d68ace..37278db 100644 --- a/stock_quant_reservation_status/views/stock_view.xml +++ b/stock_quant_reservation_status/views/stock_view.xml @@ -25,6 +25,12 @@ + + + + + +