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

16.0][FIX] report_label fix a security issue #825

Merged
merged 1 commit into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions report_label/wizards/report_label_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ def _prepare_report_data(self):
self.ensure_one()
return {
"label_format": self.label_paperformat_id.read()[0],
"label_template": self.label_template_view_id.key,
"label_template": self.label_template_view_id.sudo().key,
"offset": self.offset,
"res_model": self.model_id.model,
"res_model": self.model_id.sudo().model,
"lines": [
{
"res_id": line.res_id,
Expand Down
2 changes: 1 addition & 1 deletion report_label/wizards/report_label_wizard_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
def _compute_res_name(self):
wizard = self.mapped("wizard_id")
wizard.ensure_one()
res_model = wizard.model_id.model
res_model = wizard.model_id.sudo().model

Check warning on line 25 in report_label/wizards/report_label_wizard_line.py

View check run for this annotation

Codecov / codecov/patch

report_label/wizards/report_label_wizard_line.py#L25

Added line #L25 was not covered by tests
res_ids = self.mapped("res_id")
names_map = dict(self.env[res_model].browse(res_ids).name_get())
for rec in self:
Expand Down
Loading