Skip to content

Commit

Permalink
16.0][FIX] report_label fix a security issue that prevents regular us…
Browse files Browse the repository at this point in the history
…ers to print labels
  • Loading branch information
nayatec committed Dec 12, 2023
1 parent 7885eac commit 5b225f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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 @@ class ReportLabelWizardLine(models.TransientModel):
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

0 comments on commit 5b225f9

Please sign in to comment.