[IMP] crm: reformulate confusing error message

bzr revid: rco@openerp.com-20120130100134-yblv818qzkscjtlg
This commit is contained in:
Raphael Collet 2012-01-30 11:01:34 +01:00
parent ceaf203ce9
commit 6c07e4c2ef
1 changed files with 4 additions and 3 deletions

View File

@ -827,9 +827,10 @@ class crm_lead(crm_case, osv.osv):
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)