Hi,
I am currently migrating a v7 module to v9 Enterprise (connector_base_export module by Acsone S.A.) and I've got an issue with that piece of code :
def base(self, data, token=""):
""" Override main.ExportFormat.base """
module_installed = bool(connector_base_export_installed._name in openerp.pooler.get_pool(http.request.cr.dbname))
if module_installed:
session = ConnectorSession(http.request.cr, http.request.uid, http.request.context)
model = operator.itemgetter('model')(simplejson.loads(data))
description = _("Export %s") % self.filename(model)
launch_export_job(self, session, token, data, description, context=http.request.context)
return werkzeug.wrappers.Response(status=200)
return original_base(self, data, token)
This code replace the standard behavior of the export popup window to allow to process the export asynchronously. The async export works fine but "return werkzeug.wrappers.Response(status=200)" throws a client-side exception (works fine in v7):
http://localhost:8069/web?debug=#min=1&limit=80&view_type=list&model=res.partner&action=96&menu_id=142:1
Traceback:
SyntaxError: Unexpected end of JSON input
at HTMLIFrameElement.<anonymous> (http://localhost:8069/web/static/src/js/framework/ajax.js:232:40)
at HTMLIFrameElement.dispatch (http://localhost:8069/web/static/lib/jquery/jquery.js:4641:58)
at HTMLIFrameElement.elemData.handle (http://localhost:8069/web/static/lib/jquery/jquery.js:4309:63)
The process works fine, all I need to do is to get rid of that error message.
Any help would be greatly appreciated.
Fabian