Reports fail when ids is empty
In 6.0 version reports fail when we try pass empty list to ids
Traceback (most recent call last): File "/home/psk/.virtualenvs/tryton60/lib/python3.9/site-packages/trytond/protocols/dispatcher.py", line 181, in _dispatch result = rpc.result(meth(*c_args, **c_kwargs)) File "/home/psk/.virtualenvs/tryton60/lib/python3.9/site-packages/trytond/report/report.py", line 194, in execute groups[0], headers[0], data, action_report) IndexError: list index out of range
for example
def do_print_(self, action):
data = {
'ids': [],
'company': self.start.company.id,
'fiscalyear': self.start.fiscalyear.id,
'start_period': start_period,
'end_period': end_period,
}
return action, data
We need empty list because some reports are very complex and not neccesary is related with specific records and model, maybe are combination of several models and records.
In report/report.py, I tried fix it with this change
groups = groups[0] if groups else []
headers = headers[0] if headers else []
oext, content = cls._execute(
groups, headers, data, action_report)**
With this works!, I can to submit patch?