import logging
from odoo import api, fields, models, tools
_logger = logging.getLogger(__name__)
class sms_track(models.Model):
    _name = "mob_sms_track"
    _description = "Send SMS Track"

    model_id = fields.Char('Model', readonly=True)
    mobile_no = fields.Char('Mobile No.', readonly=True)
    response_id = fields.Char('Response', readonly=True)
    message_id = fields.Text('Messages', readonly=True)
    gateway_id = fields.Many2one('mob_gateway_setup', string='GateWay Name', readonly=True)

    @api.model
    def sms_track_create(self,sms_rendered_content, rendered_sms_to, response, model, gateway_id):
        value = {
            'model_id': model,
            'mobile_no': rendered_sms_to,
            'response_id': response,
            'message_id': sms_rendered_content,
            'gateway_id': gateway_id,
        }
        track_id = self.env['mob_sms_track'].create(value)
        return track_id
