mirror of
https://github.com/bringout/oca-ocb-core.git
synced 2026-04-20 09:32:05 +02:00
vanilla 18.0
This commit is contained in:
parent
0a7ae8db93
commit
5454004ff9
1963 changed files with 1187893 additions and 919508 deletions
|
|
@ -9,17 +9,13 @@ from werkzeug.datastructures import FileStorage
|
|||
|
||||
from odoo import http, _
|
||||
from odoo.http import content_disposition, request
|
||||
from odoo.tools import ustr, osutil
|
||||
from odoo.tools import osutil
|
||||
from odoo.tools.misc import xlsxwriter
|
||||
|
||||
|
||||
class TableExporter(http.Controller):
|
||||
|
||||
@http.route('/web/pivot/check_xlsxwriter', type='json', auth='none')
|
||||
def check_xlsxwriter(self):
|
||||
return xlsxwriter is not None
|
||||
|
||||
@http.route('/web/pivot/export_xlsx', type='http', auth="user")
|
||||
@http.route('/web/pivot/export_xlsx', type='http', auth="user", readonly=True)
|
||||
def export_xlsx(self, data, **kw):
|
||||
jdata = json.load(data) if isinstance(data, FileStorage) else json.loads(data)
|
||||
output = io.BytesIO()
|
||||
|
|
@ -93,7 +89,7 @@ class TableExporter(http.Controller):
|
|||
# Step 4: writing data
|
||||
x = 0
|
||||
for row in jdata['rows']:
|
||||
worksheet.write(y, x, row['indent'] * ' ' + ustr(row['title']), header_plain)
|
||||
worksheet.write(y, x, f"{row['indent'] * ' '}{row['title']}", header_plain)
|
||||
for cell in row['values']:
|
||||
x = x + 1
|
||||
if cell.get('is_bold', False):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue