|
@ -282,6 +282,7 @@ class Py3oReport(models.TransientModel): |
|
|
with open(result_path, 'w+') as fd: |
|
|
with open(result_path, 'w+') as fd: |
|
|
for chunk in r.iter_content(chunk_size): |
|
|
for chunk in r.iter_content(chunk_size): |
|
|
fd.write(chunk) |
|
|
fd.write(chunk) |
|
|
|
|
|
if len(model_instance) == 1: |
|
|
self._postprocess_report( |
|
|
self._postprocess_report( |
|
|
result_path, model_instance.id, save_in_attachment) |
|
|
result_path, model_instance.id, save_in_attachment) |
|
|
return result_path |
|
|
return result_path |
|
@ -345,6 +346,13 @@ class Py3oReport(models.TransientModel): |
|
|
save_in_attachment = self._check_attachment_use( |
|
|
save_in_attachment = self._check_attachment_use( |
|
|
res_ids, self.ir_actions_report_xml_id) or {} |
|
|
res_ids, self.ir_actions_report_xml_id) or {} |
|
|
reports_path = [] |
|
|
reports_path = [] |
|
|
|
|
|
if ( |
|
|
|
|
|
len(res_ids) > 1 and |
|
|
|
|
|
self.ir_actions_report_xml_id.py3o_multi_in_one): |
|
|
|
|
|
reports_path.append( |
|
|
|
|
|
self._create_single_report( |
|
|
|
|
|
model_instances, data, save_in_attachment)) |
|
|
|
|
|
else: |
|
|
for model_instance in model_instances: |
|
|
for model_instance in model_instances: |
|
|
reports_path.append( |
|
|
reports_path.append( |
|
|
self._get_or_create_single_report( |
|
|
self._get_or_create_single_report( |
|
|