문제

I have used the gspread for writing the data on Google spreadsheet. Its working fine locally but when I was trying at live server it gives me a following error.

File "/home/openerp10/openerp_7.0/addons/spreadsheet_calculate_all/spreadsheet_calculate_all.py", line 53, in insert
a = c.open(title).sheet1
File "/usr/local/lib/python2.7/dist-packages/gspread-0.1.0-py2.7.egg/gspread/client.py", line 130, in open
raise SpreadsheetNotFound
SpreadsheetNotFound

The code is as follow,

res_user = self.pool.get('res.users')
sale = self.browse(cr,uid,ids)[0]
username = res_user.browse(cr, uid, uid, context=context).gmail_user
passwd = res_user.browse(cr, uid, uid, context=context).gmail_password
title = sale.document
if title and username and passwd:
    try:
        c = gspread.Client(auth=(username,passwd))
        c.login()
        a = c.open(title).sheet1
    except Exception, e:
        raise osv.except_osv(_('User Error!'), _('Please give correct google username,password and document title.'))

Please give me any solution on it.

도움이 되었습니까?

해결책

OMG, Code is run well. The error occurs because of the Name of Spreadsheet mis-match.

I added field in Sale Order which take the char as a name of Spreadsheet.

If the field value and Google Spreadsheet Name is not same than it will gives above error.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top