diff options
Diffstat (limited to 'addons/mail')
| -rw-r--r-- | addons/mail/data/mail_data.xml | 2 | ||||
| -rw-r--r-- | addons/mail/models/mail_mail.py | 6 | ||||
| -rw-r--r-- | addons/mail/models/mail_message.py | 9 |
3 files changed, 11 insertions, 6 deletions
diff --git a/addons/mail/data/mail_data.xml b/addons/mail/data/mail_data.xml index f26beef2a71..d34c233c8c7 100644 --- a/addons/mail/data/mail_data.xml +++ b/addons/mail/data/mail_data.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <odoo> <data noupdate="1"> - <!-- Admin should not receive emails at creation --> + <!-- user root should not receive emails at creation --> <record id="base.user_root" model="res.users"> <field name="notification_type">inbox</field> </record> diff --git a/addons/mail/models/mail_mail.py b/addons/mail/models/mail_mail.py index f7731538310..6e5a3697cd8 100644 --- a/addons/mail/models/mail_mail.py +++ b/addons/mail/models/mail_mail.py @@ -36,10 +36,12 @@ class MailMail(models.Model): # Auto-detected based on create() - if 'mail_message_id' was passed then this mail is a notification # and during unlink() we will not cascade delete the parent and its attachments notification = fields.Boolean('Is Notification', help='Mail has been created to notify people of an existing mail.message') - # recipients + # recipients: include inactive partners (they may have been archived after + # the message was sent, but they should remain visible in the relation) email_to = fields.Text('To', help='Message recipients (emails)') email_cc = fields.Char('Cc', help='Carbon copy message recipients') - recipient_ids = fields.Many2many('res.partner', string='To (Partners)') + recipient_ids = fields.Many2many('res.partner', string='To (Partners)', + context={'active_test': False}) # process state = fields.Selection([ ('outgoing', 'Outgoing'), diff --git a/addons/mail/models/mail_message.py b/addons/mail/models/mail_message.py index e7d67a8c098..45bcb9498c5 100644 --- a/addons/mail/models/mail_message.py +++ b/addons/mail/models/mail_message.py @@ -77,10 +77,13 @@ class Message(models.Model): ondelete='set null', default=_get_default_author, help="Author of the message. If not set, email_from may hold an email address that did not match any partner.") author_avatar = fields.Binary("Author's avatar", related='author_id.image_small') - # recipients - partner_ids = fields.Many2many('res.partner', string='Recipients') + # recipients: include inactive partners (they may have been archived after + # the message was sent, but they should remain visible in the relation) + partner_ids = fields.Many2many('res.partner', string='Recipients', + context={'active_test': False}) needaction_partner_ids = fields.Many2many( - 'res.partner', 'mail_message_res_partner_needaction_rel', string='Partners with Need Action') + 'res.partner', 'mail_message_res_partner_needaction_rel', string='Partners with Need Action', + context={'active_test': False}) needaction = fields.Boolean( 'Need Action', compute='_get_needaction', search='_search_needaction', help='Need Action') |
