From fdf381e1b67eddda582e1387c56c56f1df4f33c1 Mon Sep 17 00:00:00 2001 From: Yenthe666 Date: Wed, 13 May 2020 06:29:43 +0000 Subject: [PATCH] [IMP] stock: show location name in warning Before this commit if you have a quant that has a location linked of the type 'view' you'd get this warning but you would not know about which location this was and figuring that out is not trivial for most people. After this commit users get notified about which location is of the type 'view' and can directly correct it if they want to. closes odoo/odoo#51137 Signed-off-by: Simon Lejeune (sle) --- addons/stock/models/stock_quant.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/models/stock_quant.py b/addons/stock/models/stock_quant.py index 60696d866db..0eea2f21a7c 100644 --- a/addons/stock/models/stock_quant.py +++ b/addons/stock/models/stock_quant.py @@ -244,7 +244,7 @@ class StockQuant(models.Model): def check_location_id(self): for quant in self: if quant.location_id.usage == 'view': - raise ValidationError(_('You cannot take products from or deliver products to a location of type "view".')) + raise ValidationError(_('You cannot take products from or deliver products to a location of type "view" (%s).') % quant.location_id.name) @api.model def _get_removal_strategy(self, product_id, location_id):