account
This commit is contained in:
19
account_reports/models/mail_scheduled_message.py
Normal file
19
account_reports/models/mail_scheduled_message.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class MailScheduledMessage(models.Model):
|
||||
_inherit = 'mail.scheduled.message'
|
||||
|
||||
account_reports_annotation_date = fields.Date("Annotated For")
|
||||
|
||||
def _message_created_hook(self, message):
|
||||
"""Hook called when a message is created from the scheduled message.
|
||||
|
||||
:param record message: the created mail.message record
|
||||
"""
|
||||
super()._message_created_hook(message)
|
||||
if self.account_reports_annotation_date:
|
||||
self.env['account.report.annotation'].with_user(self.create_uid).create({
|
||||
'date': self.account_reports_annotation_date,
|
||||
'message_id': message.id,
|
||||
})
|
||||
Reference in New Issue
Block a user