[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>
This commit is contained in:
Swapnesh Shah
2020-05-22 15:55:48 +00:00
committed by GitHub
parent 215b168a11
commit b88c755b35
+1 -1
View File
@@ -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()