Hello All,
Following error show in wizard action for Button. " jession_id = str(cj).split('~')[1].split(' ')[0]
IndexError: list index out of range"
My Python and Xml Code is Here:
**Python code:**
def sendSms(self):
url = 'http://sunarctechnologies.com'
data = 'username=' + self.user_acc.user_name + '&password=' + self.user_acc.password + '&Submit=Sign+in'
cj = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
opener.addheaders = [('User-Agent',
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120')]
try:
usock = opener.open(url, data)
except IOError:
raise Warning(_("Error pls Check account or mobile number"))
jession_id = str(cj).split('~')[1].split(' ')[0]
send_sms_url = 'http://site24.way2sms.com/smstoss.action?'
send_sms_data = 'ssaction=ss&Token=' + jession_id + '&mobile=' + self.number + '&message=' + self.message + '&msgLen=136'
opener.addheaders = [('Referer', 'http://site25.way2sms.com/sendSMS?Token=' + jession_id)]
try:
sms_sent_page = opener.open(send_sms_url, send_sms_data)
except IOError:
raise Warning(_("Error pls Check account or mobile number"))
self.date_time = str(datetime.now())
raise Warning(_("Message Sent"))
**XML Code:**
<footer>
<button name="sendSms" type="object" String="send SMS"
class="oe_highlight" icon="fa-commenting-o" confirm="Are you sure want to send sms"
attrs="{'invisible':[('date_time','!=',False)]}"
help="this button will send an sms "/>
<button string="Cancel" class="btn-default" special="cancel"/>
</footer>
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- إدارة علاقات العملاء
- e-Commerce
- المحاسبة
- المخزون
- PoS
- Project
- MRP
لقد تم الإبلاغ عن هذا السؤال
3437
أدوات العرض
هل أعجبك النقاش؟ لا تكن مستمعاً فقط. شاركنا!
أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!
تسجيلالمنشورات ذات الصلة | الردود | أدوات العرض | النشاط | |
---|---|---|---|---|
|
2
يوليو 25
|
435 | ||
|
0
ديسمبر 24
|
1078 | ||
|
2
أكتوبر 24
|
1167 | ||
|
1
أغسطس 24
|
2316 | ||
|
2
يوليو 24
|
1560 |