diff options
| author | Florent de Labarre <florent.mirieu@gmail.com> | 2018-07-13 23:39:02 +0200 |
|---|---|---|
| committer | Goffin Simon <sig@odoo.com> | 2018-07-23 12:09:12 +0200 |
| commit | 3528e804de50f0112315e23b65066ff752a3f7b2 (patch) | |
| tree | 22582289cd56923166484a470caa79183b04f952 | |
| parent | e91f10f14d2c62dad987a4727e96a26855d609cf (diff) | |
[FIX] stock: Error message don't contain the name of product
The message don't show the name of product.
Before the fix:
The message was: "It is not possible to reserve more products of than you have in stock."
After the fix:
The message is: "It is not possible to reserve more products of [0221] Product A than you have in stock."
opw:1868449
| -rw-r--r-- | addons/stock/models/stock_quant.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/stock/models/stock_quant.py b/addons/stock/models/stock_quant.py index e819385db73..d3c99edf288 100644 --- a/addons/stock/models/stock_quant.py +++ b/addons/stock/models/stock_quant.py @@ -262,12 +262,12 @@ class StockQuant(models.Model): # if we want to reserve available_quantity = self._get_available_quantity(product_id, location_id, lot_id=lot_id, package_id=package_id, owner_id=owner_id, strict=strict) if float_compare(quantity, available_quantity, precision_rounding=rounding) > 0: - raise UserError(_('It is not possible to reserve more products of %s than you have in stock.') % (', '.join(quants.mapped('product_id').mapped('display_name')))) + raise UserError(_('It is not possible to reserve more products of %s than you have in stock.') % product_id.display_name) elif float_compare(quantity, 0, precision_rounding=rounding) < 0: # if we want to unreserve available_quantity = sum(quants.mapped('reserved_quantity')) if float_compare(abs(quantity), available_quantity, precision_rounding=rounding) > 0: - raise UserError(_('It is not possible to unreserve more products of %s than you have in stock.') % (', '.join(quants.mapped('product_id').mapped('display_name')))) + raise UserError(_('It is not possible to unreserve more products of %s than you have in stock.') % product_id.display_name) else: return reserved_quants |
