[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>
This commit is contained in:
Yenthe666
2020-06-23 09:52:11 +00:00
committed by root
parent dd23daec01
commit fdf381e1b6
+1 -1
View File
@@ -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):