[IMP] snailmail: create notifications in batch
UDPATE ME Task ID-2330149 COM PR odoo/odoo#61246 ENT PR odoo/enterprise#14561
This commit is contained in:
committed by
Thibault Delavallée
parent
18b49836b7
commit
e045e5d925
@@ -97,8 +97,9 @@ class SnailmailLetter(models.Model):
|
||||
})
|
||||
letters = super().create(vals_list)
|
||||
|
||||
notification_vals = []
|
||||
for letter in letters:
|
||||
self.env['mail.notification'].sudo().create({
|
||||
notification_vals.append({
|
||||
'mail_message_id': letter.message_id.id,
|
||||
'res_partner_id': letter.partner_id.id,
|
||||
'notification_type': 'snail',
|
||||
@@ -107,6 +108,8 @@ class SnailmailLetter(models.Model):
|
||||
'notification_status': 'ready',
|
||||
})
|
||||
|
||||
self.env['mail.notification'].sudo().create(notification_vals)
|
||||
|
||||
return letters
|
||||
|
||||
def _fetch_attachment(self):
|
||||
|
||||
Reference in New Issue
Block a user