Printing reports without any selected record crashes
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.
Files
Download | Creator | Timestamp | Type |
---|---|---|---|
report_py.patch | @rvong | 2021-07-27 19:59:41.955000 UTC | text/plain |