mirror of
https://github.com/bringout/oca-ocb-mail.git
synced 2026-04-20 10:42:00 +02:00
Initial commit: Mail packages
This commit is contained in:
commit
4e53507711
1948 changed files with 751201 additions and 0 deletions
29
odoo-bringout-oca-ocb-sms/sms/wizard/sms_template_reset.py
Normal file
29
odoo-bringout-oca-ocb-sms/sms/wizard/sms_template_reset.py
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import fields, models, _
|
||||
|
||||
|
||||
class SMSTemplateReset(models.TransientModel):
|
||||
_name = 'sms.template.reset'
|
||||
_description = 'SMS Template Reset'
|
||||
|
||||
template_ids = fields.Many2many('sms.template')
|
||||
|
||||
def reset_template(self):
|
||||
if not self.template_ids:
|
||||
return False
|
||||
self.template_ids.reset_template()
|
||||
if self.env.context.get('params', {}).get('view_type') == 'list':
|
||||
next_action = {'type': 'ir.actions.client', 'tag': 'reload'}
|
||||
else:
|
||||
next_action = {'type': 'ir.actions.act_window_close'}
|
||||
return {
|
||||
'type': 'ir.actions.client',
|
||||
'tag': 'display_notification',
|
||||
'params': {
|
||||
'type': 'success',
|
||||
'message': _('SMS Templates have been reset'),
|
||||
'next': next_action,
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue