[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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user