mirror of
https://github.com/bringout/oca-ocb-core.git
synced 2026-04-21 09:12:03 +02:00
Initial commit: Core packages
This commit is contained in:
commit
12c29a983b
9512 changed files with 8379910 additions and 0 deletions
|
|
@ -0,0 +1,25 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import models
|
||||
from odoo import api
|
||||
|
||||
|
||||
class MailThread(models.AbstractModel):
|
||||
_inherit = 'mail.thread'
|
||||
|
||||
def _notify_cancel_snail(self):
|
||||
author_id = self.env.user.id
|
||||
letters = self.env['snailmail.letter'].search([
|
||||
('state', 'not in', ['sent', 'canceled', 'pending']),
|
||||
('user_id', '=', author_id),
|
||||
('model', '=', self._name)
|
||||
])
|
||||
letters.cancel()
|
||||
|
||||
@api.model
|
||||
def notify_cancel_by_type(self, notification_type):
|
||||
super().notify_cancel_by_type(notification_type)
|
||||
if notification_type == 'snail':
|
||||
self._notify_cancel_snail()
|
||||
return True
|
||||
Loading…
Add table
Add a link
Reference in a new issue