summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSwapnesh Shah <swapneshshah111@gmail.com>2020-05-22 15:55:48 +0000
committerGitHub <noreply@github.com>2020-05-22 15:55:48 +0000
commitb88c755b35b59d4565eafb8cd732db23b8dad047 (patch)
tree069352a3726c8ca6d74bbbe51ff535a6cd200839
parent215b168a1182f8800a1e5edd081b908ae407c338 (diff)
[IMP] stock: display full product name in warning
Displaying full name with code helps to Identify Products with `default_code` in the warning message. (Especially when variants are activated) closes odoo/odoo#51720 Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
-rw-r--r--addons/stock/models/stock_inventory.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/stock/models/stock_inventory.py b/addons/stock/models/stock_inventory.py
index 6dac04c3da1..cf7206fbcd3 100644
--- a/addons/stock/models/stock_inventory.py
+++ b/addons/stock/models/stock_inventory.py
@@ -117,7 +117,7 @@ class Inventory(models.Model):
def _action_done(self):
negative = next((line for line in self.mapped('line_ids') if line.product_qty < 0 and line.product_qty != line.theoretical_qty), False)
if negative:
- raise UserError(_('You cannot set a negative product quantity in an inventory line:\n\t%s - qty: %s') % (negative.product_id.name, negative.product_qty))
+ raise UserError(_('You cannot set a negative product quantity in an inventory line:\n\t%s - qty: %s') % (negative.product_id.display_name, negative.product_qty))
self.action_check()
self.write({'state': 'done'})
self.post_inventory()