[IMP] mail : Partners should always be replaced with Customer, Supplier, or Contact (if it can be both).

bzr revid: mdi@tinyerp.com-20121008090529-pi43dm3zxc1jsqbm
This commit is contained in:
Divyesh Makwana (Open ERP)
2012-10-08 14:35:29 +05:30
parent 09e5d404df
commit a1c29dd85b
+6 -1
View File
@@ -580,8 +580,13 @@ class mail_message(osv.Model):
partner_wo_email_lst.append(partner)
if not partner_wo_email_lst:
return {}
warning_msg = _('The following contacts do not have an email address specified.')
for partner in partner_wo_email_lst:
terminology = 'Contact'
if partner.customer and not partner.supplier:
terminology = 'Customer'
elif partner.supplier and not partner.customer:
terminology = 'Supplier'
warning_msg = _('The following %s do not have an email address specified.') % (terminology,)
warning_msg += '\n- %s' % (partner.name)
return {'warning': {
'title': _('Email not found'),