[IMP] mail : Partners should always be replaced with Customer, Supplier, or Contact...
authorDivyesh Makwana (Open ERP) <mdi@tinyerp.com>
Mon, 8 Oct 2012 09:05:29 +0000 (14:35 +0530)
committerDivyesh Makwana (Open ERP) <mdi@tinyerp.com>
Mon, 8 Oct 2012 09:05:29 +0000 (14:35 +0530)
bzr revid: mdi@tinyerp.com-20121008090529-pi43dm3zxc1jsqbm

addons/mail/mail_message.py

index 61ea9fb..68e40ef 100644 (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'),