Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0][FIX] - Field print report name should take into account #916

Open
wants to merge 1 commit into
base: 17.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions report_xlsx/models/ir_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,15 @@
attachment_values["name"],
)
return attachment, record

def report_action(self, docids, data=None, config=True):
self.ensure_one()
res = super().report_action(docids, data=data, config=config)
if self.report_type == "xlsx" and len(docids) == 1:
# We have to do this, Otherwise, the Excel report will never get field
# print_report_name.
# Check code in file oca-reporting-engine/report_xlsx/controllers/main.py
# in report_download function to see that the report_name need to + / + id
# to get the value of print_report_name.
res.update({"report_name": self.report_name + "/" + str(docids[0])})

Check warning on line 90 in report_xlsx/models/ir_report.py

View check run for this annotation

Codecov / codecov/patch

report_xlsx/models/ir_report.py#L90

Added line #L90 was not covered by tests
return res
Loading