Message 67524

Author
pokoli
Date
2021-05-12.09:32:08
Message id
67524

Content

I get several tracebacks when printing reports without any selected record. I expect an empty report is shown instead of a traceback.

On 6.0 series, from sale or invoice report I get the following traceback:

Traceback (most recent call last):
  File "/usr/local/lib/python37/dist-packages/trytond/wsgipy", line 117, in dispatch_request
    return endpoint(request, **requestview_args)
  File "/usr/local/lib/python37/dist-packages/trytond/protocols/dispatcherpy", line 48, in rpc
    request, database_name, *requestrpc_params)
  File "/usr/local/lib/python37/dist-packages/trytond/wsgipy", line 84, in auth_required
    return wrapped(*args, **kwargs)
  File "/usr/local/lib/python37/dist-packages/trytond/protocols/wrapperspy", line 156, in wrapper
    return func(request, pool, *args, **kwargs)
  File "/usr/local/lib/python37/dist-packages/trytond/protocols/dispatcherpy", line 181, in _dispatch
    result = rpcresult(meth(*c_args, **c_kwargs))
  File "/usr/local/lib/python37/dist-packages/trytond/modules/sale/salepy", line 1777, in execute
    return super(SaleReport, cls)execute(ids, data)
  File "/usr/local/lib/python37/dist-packages/trytond/report/reportpy", line 194, in execute
    groups[0], headers[0], data, action_report)
IndexError: list index out of range

On 5.8 series, on the invoice report (sale reports works well) I get the following traceback:

Traceback (most recent call last):
  File "/usr/local/lib/python37/dist-packages/trytond/wsgipy", line 116, in dispatch_request
    return endpoint(request, **requestview_args)
  File "/usr/local/lib/python37/dist-packages/trytond/protocols/dispatcherpy", line 48, in rpc
    request, database_name, *requestrpc_params)
  File "/usr/local/lib/python37/dist-packages/trytond/wsgipy", line 83, in auth_required
    return wrapped(*args, **kwargs)
  File "/usr/local/lib/python37/dist-packages/trytond/protocols/wrapperspy", line 131, in wrapper
    return func(request, pool, *args, **kwargs)
  File "/usr/local/lib/python37/dist-packages/trytond/protocols/dispatcherpy", line 181, in _dispatch
    result = rpcresult(meth(*c_args, **c_kwargs))
  File "/usr/local/lib/python37/dist-packages/trytond/modules/account_invoice/invoicepy", line 2629, in execute
    return super()execute(ids, data)
  File "/usr/local/lib/python37/dist-packages/trytond/report/reportpy", line 165, in execute
    oext, content = cls_execute(records, data, action_report)
  File "/usr/local/lib/python37/dist-packages/trytond/modules/account_invoice/invoicepy", line 2601, in _execute
    invoice, = Invoicebrowse(records)
ValueError: not enough values to unpack (expected 1, got 0)

Both can be reproduced on demo server by just deselecting the records and using the print action of the modules.

History
Date User Action Args
2021-05-12 09:32:08pokolisetmessageid: <1620804728.369628.376HPB7NELPPTXRU.issue10409@tryton.org>
2021-05-12 09:32:08pokolilinkissue10409 messages
2021-05-12 09:32:08pokolicreate

Showing 10 items. Show all history (warning: this could be VERY long)