mail_notification.py 760 B

12345678910111213141516171819202122
  1. # -*- coding: utf-8 -*-
  2. # Part of Odoo. See LICENSE file for full copyright and licensing details.
  3. from odoo import fields, models
  4. class MailNotification(models.Model):
  5. _inherit = 'mail.notification'
  6. notification_type = fields.Selection(selection_add=[
  7. ('sms', 'SMS')
  8. ], ondelete={'sms': 'cascade'})
  9. sms_id = fields.Many2one('sms.sms', string='SMS', index='btree_not_null', ondelete='set null')
  10. sms_number = fields.Char('SMS Number')
  11. failure_type = fields.Selection(selection_add=[
  12. ('sms_number_missing', 'Missing Number'),
  13. ('sms_number_format', 'Wrong Number Format'),
  14. ('sms_credit', 'Insufficient Credit'),
  15. ('sms_server', 'Server Error'),
  16. ('sms_acc', 'Unregistered Account')
  17. ])