diff --git a/res_partner_mails_count/models.py b/res_partner_mails_count/models.py
index dcd036a..0ca91e6 100644
--- a/res_partner_mails_count/models.py
+++ b/res_partner_mails_count/models.py
@@ -11,7 +11,7 @@ class res_partner(models.Model):
@api.one
def _mails_to(self):
for r in self:
- r.mails_to = self.env['mail.message'].sudo().search_count([('partner_ids', 'in', r.id)])
+ r.mails_to = self.env['mail.message'].sudo().search_count([('notified_partner_ids', 'in', r.id)])
@api.one
def _mails_from(self):
diff --git a/res_partner_mails_count/templates.xml b/res_partner_mails_count/templates.xml
index 29c6de1..936ba1c 100644
--- a/res_partner_mails_count/templates.xml
+++ b/res_partner_mails_count/templates.xml
@@ -9,6 +9,19 @@
type="text/javascript">
+
+
+ mail.message.search.notified_partner
+ mail.message
+ 50
+
+
+
+
+
+
+
+
res.partner.mails.count
res.partner
@@ -18,7 +31,7 @@
@@ -32,4 +45,4 @@
-
\ No newline at end of file
+