def unlink(self, cr, uid, ids, context=None):
for lead in self.browse(cr, uid, ids, context):
- if (not lead.section_id.allow_unlink) and (lead.state <> 'draft'):
- raise osv.except_osv(_('Warning !'),
- _('You can not delete this lead. You should better cancel it.'))
+ if (not lead.section_id.allow_unlink) and (lead.state != 'draft'):
+ raise osv.except_osv(_('Error'),
+ _("You cannot delete lead '%s'; it must be in state 'Draft' to be deleted. " \
+ "You should better cancel it, instead of deleting it.") % lead.name)
return super(crm_lead, self).unlink(cr, uid, ids, context)