Browse Source

continue refactoring, improve api, add boutton on sms view for sending/retrying/cancelling, improve and fix wizard for sending massive sms

pull/128/head
Sébastien BEAU 9 years ago
committed by MonsieurB
parent
commit
8b553736a2
  1. 22
      smsclient_ovh/smsclient.py

22
smsclient_ovh/smsclient.py

@ -32,14 +32,14 @@ class SmsClient(models.Model):
@api.model @api.model
def get_method(self): 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 return method
@api.onchange('method') @api.onchange('method')
def onchange_method(self): 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.url_visible = True
self.sms_account_visible = True self.sms_account_visible = True
self.login_provider_visible = True self.login_provider_visible = True
@ -59,14 +59,14 @@ class SmsSms(models.Model):
_inherit = "sms.sms" _inherit = "sms.sms"
@api.model @api.model
def _prepare_ovh_http(self):
def _prepare_http_ovh(self):
params = { 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: if self.nostop:
params['noStop'] = 1 params['noStop'] = 1

Loading…
Cancel
Save