[FIX]google_spreadsheet: if formula contained html special chars, the formula was not written on the spreadsheet. The formula is now html escaped before sending the writting request on the spreadsheet.
bzr revid: dle@openerp.com-20131127133500-18vra6sqs6cb3loh
This commit is contained in:
parent
0d13df5a57
commit
0ecdb5dec7
|
@ -18,6 +18,7 @@
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
|
import cgi
|
||||||
import simplejson
|
import simplejson
|
||||||
import logging
|
import logging
|
||||||
from lxml import etree
|
from lxml import etree
|
||||||
|
@ -67,24 +68,24 @@ class config(osv.osv):
|
||||||
request = '''<feed xmlns="http://www.w3.org/2005/Atom"
|
request = '''<feed xmlns="http://www.w3.org/2005/Atom"
|
||||||
xmlns:batch="http://schemas.google.com/gdata/batch"
|
xmlns:batch="http://schemas.google.com/gdata/batch"
|
||||||
xmlns:gs="http://schemas.google.com/spreadsheets/2006">
|
xmlns:gs="http://schemas.google.com/spreadsheets/2006">
|
||||||
<id>https://spreadsheets.google.com/feeds/cells/%s/od6/private/full</id>
|
<id>https://spreadsheets.google.com/feeds/cells/{key}/od6/private/full</id>
|
||||||
<entry>
|
<entry>
|
||||||
<batch:id>A1</batch:id>
|
<batch:id>A1</batch:id>
|
||||||
<batch:operation type="update"/>
|
<batch:operation type="update"/>
|
||||||
<id>https://spreadsheets.google.com/feeds/cells/%s/od6/private/full/R1C1</id>
|
<id>https://spreadsheets.google.com/feeds/cells/{key}/od6/private/full/R1C1</id>
|
||||||
<link rel="edit" type="application/atom+xml"
|
<link rel="edit" type="application/atom+xml"
|
||||||
href="https://spreadsheets.google.com/feeds/cells/%s/od6/private/full/R1C1"/>
|
href="https://spreadsheets.google.com/feeds/cells/{key}/od6/private/full/R1C1"/>
|
||||||
<gs:cell row="1" col="1" inputValue="%s"/>
|
<gs:cell row="1" col="1" inputValue="{formula}"/>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
<batch:id>A2</batch:id>
|
<batch:id>A2</batch:id>
|
||||||
<batch:operation type="update"/>
|
<batch:operation type="update"/>
|
||||||
<id>https://spreadsheets.google.com/feeds/cells/%s/od6/private/full/R60C15</id>
|
<id>https://spreadsheets.google.com/feeds/cells/{key}/od6/private/full/R60C15</id>
|
||||||
<link rel="edit" type="application/atom+xml"
|
<link rel="edit" type="application/atom+xml"
|
||||||
href="https://spreadsheets.google.com/feeds/cells/%s/od6/private/full/R60C15"/>
|
href="https://spreadsheets.google.com/feeds/cells/{key}/od6/private/full/R60C15"/>
|
||||||
<gs:cell row="60" col="15" inputValue="%s"/>
|
<gs:cell row="60" col="15" inputValue="{config}"/>
|
||||||
</entry>
|
</entry>
|
||||||
</feed>''' % (spreadsheet_key, spreadsheet_key, spreadsheet_key, formula.replace('"', '"'), spreadsheet_key, spreadsheet_key, config_formula.replace('"', '"'))
|
</feed>''' .format(key=spreadsheet_key, formula=cgi.escape(formula, quote=True), config=cgi.escape(config_formula, quote=True))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
req = urllib2.Request(
|
req = urllib2.Request(
|
||||||
|
|
Loading…
Reference in New Issue