diff --git a/mail_private/__manifest__.py b/mail_private/__manifest__.py index 80391dd..0a32ca1 100644 --- a/mail_private/__manifest__.py +++ b/mail_private/__manifest__.py @@ -3,7 +3,7 @@ "summary": """Send private messages to specified recipients, regardless of who are in followers list.""", "category": "Discuss", "images": ['images/mail_private_image.png'], - "version": "11.0.1.0.2", + "version": "11.0.1.1.0", "application": False, "author": "IT-Projects LLC, Pavel Romanchenko", diff --git a/mail_private/doc/changelog.rst b/mail_private/doc/changelog.rst index 20569d5..4a5f5f0 100644 --- a/mail_private/doc/changelog.rst +++ b/mail_private/doc/changelog.rst @@ -1,3 +1,8 @@ +`1.1.0` +------- + +- **New**: internal users are flagged automatically. + `1.0.2` ------- diff --git a/mail_private/models.py b/mail_private/models.py index dd6b60d..ae63b3f 100644 --- a/mail_private/models.py +++ b/mail_private/models.py @@ -16,13 +16,14 @@ class MailMessage(models.Model): result = [] default_resource = self.env[model].search(domain) follower_ids = default_resource.message_follower_ids + internal_ids = self.get_internal_users_ids() recipient_ids = [r.partner_id for r in follower_ids if r.partner_id] # channel_ids = [c.channel_id for c in follower_ids if c.channel_id] for recipient in recipient_ids: result.append({ - 'checked': len(recipient.user_ids) > 0, + 'checked': recipient.user_ids.id in internal_ids, 'partner_id': recipient.id, 'full_name': recipient.name, 'name': recipient.name, @@ -106,3 +107,7 @@ class MailMessage(models.Model): self.parent_id.invalidate_cache() return True + + def get_internal_users_ids(self): + internal_users_ids = self.env['res.users'].search([('share', '=', False)]).ids + return internal_users_ids