From 8b553736a2228fb8dda27a106162dbae6adbe058 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20BEAU?= Date: Mon, 21 Sep 2015 23:45:21 +0200 Subject: [PATCH] continue refactoring, improve api, add boutton on sms view for sending/retrying/cancelling, improve and fix wizard for sending massive sms --- smsclient_ovh/smsclient.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/smsclient_ovh/smsclient.py b/smsclient_ovh/smsclient.py index 96d4763..4643845 100644 --- a/smsclient_ovh/smsclient.py +++ b/smsclient_ovh/smsclient.py @@ -32,14 +32,14 @@ class SmsClient(models.Model): @api.model def get_method(self): - method = super(smsclient, self).get_method() - method.append(('ovh_http', 'OVH HTTP'), ) + method = super(SmsClient, self).get_method() + method.append(('http_ovh', 'OVH HTTP'), ) return method @api.onchange('method') def onchange_method(self): - super(smsclient, self).onchange_method() - if self.method == 'ovh http': + super(SmsClient, self).onchange_method() + if self.method == 'http_ovh': self.url_visible = True self.sms_account_visible = True self.login_provider_visible = True @@ -59,14 +59,14 @@ class SmsSms(models.Model): _inherit = "sms.sms" @api.model - def _prepare_ovh_http(self): + def _prepare_http_ovh(self): params = { - 'smsAccount': gateway.sms_account, - 'login': gateway.login_provider, - 'password': gateway.password_provider, - 'from': gateway.from_provider, - 'to': self.mobile_to, - 'message': self.text, + 'smsAccount': self.gateway_id.sms_account, + 'login': self.gateway_id.login_provider, + 'password': self.gateway_id.password_provider, + 'from': self.gateway_id.from_provider, + 'to': self.mobile, + 'message': self.message, } if self.nostop: params['noStop'] = 1