diff --git a/res_partner_mails_count/models.py b/res_partner_mails_count/models.py index 965ec60..dcd036a 100644 --- a/res_partner_mails_count/models.py +++ b/res_partner_mails_count/models.py @@ -5,15 +5,15 @@ from openerp import models, fields, api class res_partner(models.Model): _inherit = 'res.partner' - mails_from = fields.Integer(compute="_mails_from") mails_to = fields.Integer(compute="_mails_to") + mails_from = fields.Integer(compute="_mails_from") @api.one - def _mails_from(self): + def _mails_to(self): for r in self: - r.mails_from = self.env['mail.message'].sudo().search_count([('partner_ids', 'in', r.id)]) + r.mails_to = self.env['mail.message'].sudo().search_count([('partner_ids', 'in', r.id)]) @api.one - def _mails_to(self): + def _mails_from(self): for r in self: - r.mails_to = self.env['mail.message'].sudo().search_count([('author_id', '=', r.id)]) + r.mails_from = self.env['mail.message'].sudo().search_count([('author_id', '=', r.id)]) diff --git a/res_partner_mails_count/templates.xml b/res_partner_mails_count/templates.xml index 1cae718..8339909 100644 --- a/res_partner_mails_count/templates.xml +++ b/res_partner_mails_count/templates.xml @@ -9,16 +9,16 @@ diff --git a/res_partner_mails_count/views/res_partner_mails_count.xml b/res_partner_mails_count/views/res_partner_mails_count.xml index d9f01d0..8d048e6 100644 --- a/res_partner_mails_count/views/res_partner_mails_count.xml +++ b/res_partner_mails_count/views/res_partner_mails_count.xml @@ -1,29 +1,17 @@ - - Mails from + + Mails + mail.wall mail.message tree,form { - 'active_test': False, + 'ignore_search_model': True, }

- Mails from -

-
-
- - Mails to - mail.message - tree,form - { - 'active_test': False, - } - -

- Mails to + Mails not found. Probably, they exist, but you don't have access.