You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
1.2 KiB

8 years ago
8 years ago
  1. # coding: utf-8
  2. # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
  3. # Copyright (C) 2013 Julius Network Solutions SARL <contact@julius.fr>
  4. # Copyright (C) 2015 Valentin Chemiere <valentin.chemiere@akretion.com>
  5. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  6. from odoo import models, fields
  7. class ServerAction(models.Model):
  8. """
  9. Possibility to specify the SMS Gateway when configure this server action
  10. """
  11. _inherit = 'ir.actions.server'
  12. state = fields.Selection(selection_add=[
  13. ('sms', 'Send SMS'),
  14. ])
  15. mobile = fields.Char(
  16. string='Mobile No',
  17. help="Field to be used to fetch the mobile number, e.g. you select"
  18. " the invoice model and `object.invoice_address_id.mobile` "
  19. "will be the field providing the correct mobile number.")
  20. sms = fields.Char(string='SMS', size=160, translate=True)
  21. sms_server_id = fields.Many2one(
  22. comodel_name='sms.gateway', string='SMS Server',
  23. help='Select the SMS Gateway configuration to use with this action.')
  24. sms_template_id = fields.Many2one(
  25. comodel_name='mail.template', string='SMS Template',
  26. help='Select the SMS Template configuration to use with this action.')