mirror of
https://github.com/bringout/oca-ocb-core.git
synced 2026-04-20 19:52:00 +02:00
19.0 vanilla
This commit is contained in:
parent
d1963a3c3a
commit
2d3ee4855a
7430 changed files with 2687981 additions and 2965473 deletions
20
odoo-bringout-oca-ocb-mail/mail/models/ir_cron.py
Normal file
20
odoo-bringout-oca-ocb-mail/mail/models/ir_cron.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import fields, models, SUPERUSER_ID
|
||||
|
||||
|
||||
class IrCron(models.AbstractModel):
|
||||
_name = 'ir.cron'
|
||||
_inherit = ['ir.cron', 'mail.thread', 'mail.activity.mixin']
|
||||
|
||||
user_id = fields.Many2one(tracking=True)
|
||||
interval_number = fields.Integer(tracking=True)
|
||||
interval_type = fields.Selection(tracking=True)
|
||||
priority = fields.Integer(tracking=True)
|
||||
|
||||
def _notify_admin(self, message):
|
||||
""" Send a notification to the admin users. """
|
||||
channel_admin = self.env.ref("mail.channel_admin", raise_if_not_found=False)
|
||||
if channel_admin:
|
||||
channel_admin.with_user(SUPERUSER_ID).message_post(body=message)
|
||||
super()._notify_admin(message)
|
||||
Loading…
Add table
Add a link
Reference in a new issue