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()