diff --git a/addons/stock/models/stock_quant.py b/addons/stock/models/stock_quant.py index e6cecfdbf0304f89f89a837f90f79db643999d20..522346741acdca1cb4316eaed4430d8b86479870 100644 --- a/addons/stock/models/stock_quant.py +++ b/addons/stock/models/stock_quant.py @@ -235,7 +235,8 @@ class StockQuant(models.Model): @api.constrains('quantity') def check_quantity(self): for quant in self: - if float_compare(quant.quantity, 1, precision_rounding=quant.product_uom_id.rounding) > 0 and quant.lot_id and quant.product_id.tracking == 'serial': + if quant.location_id.usage != 'inventory' and quant.lot_id and quant.product_id.tracking == 'serial' \ + and float_compare(abs(quant.quantity), 1, precision_rounding=quant.product_uom_id.rounding) > 0: message_base = _('A serial number should only be linked to a single product.') message_quant = _('Please check the following serial number (name, id): ') message_sn = '(%s, %s)' % (quant.lot_id.name, quant.lot_id.id)