Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions stock_batch_picking_voucher/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@

class ReportController(report.ReportController):
@route()
def report_download(self, data, context=None):
def report_download(self, data, context=None, token=None, **kwargs):
"""This function is used by 'qwebactionmanager.js' in order to trigger
the download of a py3o/controller report.
:param data: a javascript array JSON.stringified containg report
internal url ([0]) and type [1]
:returns: Response with a filetoken cookie and an attachment header
"""
response = super().report_download(data, context)
response = super().report_download(data, context=context, token=token, **kwargs)
# NTH detect if the binary is a PDF, no matter ifn it was generated by a QWeb or Aeroo
requestcontent = json.loads(data)
type = requestcontent[1]
Expand Down
4 changes: 2 additions & 2 deletions stock_voucher_ux/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ def _count_pages_with_products(self, pdf_reader, picking_id):
return max(1, pages_with_products)

@route()
def report_download(self, data, context=None):
def report_download(self, data, context=None, token=None, **kwargs):
"""This function is used by 'qwebactionmanager.js' in order to trigger
the download of a py3o/controller report.
:param data: a javascript array JSON.stringified containg report
internal url ([0]) and type [1]
:returns: Response with a filetoken cookie and an attachment header
"""
response = super().report_download(data, context)
response = super().report_download(data, context=context, token=token, **kwargs)
# NTH detect if the binary is a PDF, no matter ifn it was generated by a QWeb or Aeroo
requestcontent = json.loads(data)
url, type = requestcontent[0], requestcontent[1]
Expand Down