Skip to content

Commit f5f1d8f

Browse files
[FIX]report_xlsx: field print_report_name should be taken into account
1 parent b69c1d7 commit f5f1d8f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

report_xlsx/models/ir_report.py

+12
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,15 @@ def save_xlsx_report_attachment(self, docids, report_contents):
7777
attachment_values["name"],
7878
)
7979
return attachment, record
80+
81+
def report_action(self, docids, data=None, config=True):
82+
self.ensure_one()
83+
res = super().report_action(docids, data=data, config=config)
84+
if self.report_type == "xlsx" and len(docids) == 1:
85+
# We have to do this, Otherwise, the Excel report will never get field
86+
# print_report_name.
87+
# Check code in file oca-reporting-engine/report_xlsx/controllers/main.py
88+
# in report_download function to see that the report_name need to + / + id
89+
# to get the value of print_report_name.
90+
res.update({"report_name": self.report_name + "/" + str(docids[0])})
91+
return res

0 commit comments

Comments
 (0)