summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorYenthe666 <yenthevg@gmail.com>2020-05-13 06:29:43 +0000
committerroot <yenthevg@gmail.com>2020-06-23 09:52:11 +0000
commitfdf381e1b67eddda582e1387c56c56f1df4f33c1 (patch)
treeffa23a7c70cdd5249f141e2c6e3f760930476ecb /addons
parentdd23daec01a3bc78e63d12b075c73c6bb74ae60b (diff)
[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) <sle@openerp.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/stock/models/stock_quant.py2
1 files changed, 1 insertions, 1 deletions
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):