[FIX] mrp_subcontracting: clarify which product to specify SN

In case you use products with variants or internal references, display_name is more specific than name.

closes odoo/odoo#79191

X-original-commit: c46328315a8db2f579329a8a44c23fd4769e7d44
Signed-off-by: Tiffany Chang <tic@odoo.com>
This commit is contained in:
Florent de Labarre
2021-10-29 11:54:28 +00:00
committed by Tiffany Chang (tic)
parent 6b8c367a16
commit a8ec7ddcb0
@@ -45,7 +45,7 @@ class MrpProduction(models.Model):
raise UserError(_('You must enter a serial number for %s') % self.product_id.name)
for sml in self.move_raw_ids.move_line_ids:
if sml.tracking != 'none' and not sml.lot_id:
raise UserError(_('You must enter a serial number for each line of %s') % sml.product_id.name)
raise UserError(_('You must enter a serial number for each line of %s') % sml.product_id.display_name)
consumption_issues = self._get_consumption_issues()
if consumption_issues:
return self._action_generate_consumption_wizard(consumption_issues)