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

[FIX][15.0] base_report_to_printer: Fix access error on product label #385

Open
wants to merge 1 commit into
base: 15.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
3 changes: 2 additions & 1 deletion base_report_to_printer/models/ir_actions_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,10 @@
if not printer:
raise exceptions.UserError(_("No printer configured to print this report."))
if self.print_report_name:
model = (data or {}).get("active_model", self.model)

Check warning on line 169 in base_report_to_printer/models/ir_actions_report.py

View check run for this annotation

Codecov / codecov/patch

base_report_to_printer/models/ir_actions_report.py#L169

Added line #L169 was not covered by tests
report_file_names = [
safe_eval(self.print_report_name, {"object": obj, "time": time})
for obj in self.env[self.model].browse(record_ids)
for obj in self.env[model].browse(record_ids)
]
title = " ".join(report_file_names)
if len(title) > 80:
Expand Down
Loading