Crash when printing party letter
On 6.0 series, printing the party letter produces the following crash:
Warning:
Traceback (most recent call last):
File "/usr/local/lib/python37/dist-packages/trytond/model/modelstoragepy", line 1458, in __getattr__
field = self_fields[name]
KeyError: 'company'
During handling of the above exception, another exception occurred:
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/company/partypy", line 136, in execute
return super(LetterReport, cls)execute(ids, data)
File "/usr/local/lib/python37/dist-packages/trytond/report/reportpy", line 172, in execute
for key, group in groupby(records, key=clsheader_key):
File "/usr/local/lib/python37/dist-packages/trytond/modules/company/companypy", line 145, in header_key
return super()header_key(record) + (('company', recordcompany),)
File "/usr/local/lib/python37/dist-packages/trytond/report/reportpy", line 241, in __getattr__
return getattr(record, name)
File "/usr/local/lib/python37/dist-packages/trytond/model/modelstoragepy", line 1460, in __getattr__
raise AttributeError('"%s" has no attribute "%s"' % (self, name))
AttributeError: "partyparty,2" has no attribute "company"
I think we should remove the CompanyReport from the PartyLetter.