mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[add] port web_export_view to OpenERP 7
This commit is contained in:
committed by
Pedro M. Baeza
parent
d6ee226cd4
commit
5327689b97
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>)
|
||||
# Copyright (C) 2012 Domsense srl (<http://www.domsense.com>)
|
||||
#
|
||||
@@ -23,7 +23,7 @@ try:
|
||||
except ImportError:
|
||||
import simplejson as json
|
||||
|
||||
import web.common.http as openerpweb
|
||||
import web.http as openerpweb
|
||||
|
||||
from web.controllers.main import ExcelExport
|
||||
|
||||
@@ -34,13 +34,16 @@ class ExcelExportView(ExcelExport):
|
||||
@openerpweb.httprequest
|
||||
def index(self, req, data, token):
|
||||
data = json.loads(data)
|
||||
model = data.get('model',[])
|
||||
columns_headers = data.get('headers',[])
|
||||
rows = data.get('rows',[])
|
||||
model = data.get('model', [])
|
||||
columns_headers = data.get('headers', [])
|
||||
rows = data.get('rows', [])
|
||||
|
||||
context = req.session.eval_context(req.context)
|
||||
|
||||
return req.make_response(self.from_data(columns_headers, rows),
|
||||
headers=[('Content-Disposition', 'attachment; filename="%s"' % self.filename(model)),
|
||||
('Content-Type', self.content_type)],
|
||||
cookies={'fileToken': int(token)})
|
||||
return req.make_response(
|
||||
self.from_data(columns_headers, rows),
|
||||
headers=[
|
||||
('Content-Disposition', 'attachment; filename="%s"'
|
||||
% self.filename(model)),
|
||||
('Content-Type', self.content_type)
|
||||
],
|
||||
cookies={'fileToken': int(token)}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user