From 1f17cbfbd9b3ccd2d0413649eeb65bcfc69e15bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20BEAU?= Date: Mon, 8 Jul 2019 12:05:44 +0200 Subject: [PATCH] fixup! [FIX] fix negative quant in blocked location --- stock_location_lockdown/models/stock_quant.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stock_location_lockdown/models/stock_quant.py b/stock_location_lockdown/models/stock_quant.py index 6a71e16f8..89b6b45ef 100644 --- a/stock_location_lockdown/models/stock_quant.py +++ b/stock_location_lockdown/models/stock_quant.py @@ -3,7 +3,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import api, models, _ -from odoo.exceptions import UserError +from odoo.exceptions import ValidationError class StockQuant(models.Model): @@ -13,7 +13,7 @@ class StockQuant(models.Model): def _check_location_blocked(self): for record in self: if record.location_id.block_stock_entrance: - raise UserError( + raise ValidationError( _('The location %s is blocked and can ' 'not be used for moving the product %s') % (record.location_id.name, record.product_id.name)