16.0][FIX] report_label fix a security issue that prevents regular users to print labels

pull/825/head
Olivier Nibart 2023-12-12 16:41:20 +01:00
parent 7885eac098
commit 5b225f9e61
2 changed files with 3 additions and 3 deletions

View File

@ -61,9 +61,9 @@ class ReportLabelWizard(models.TransientModel):
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,

View File

@ -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
res_ids = self.mapped("res_id")
names_map = dict(self.env[res_model].browse(res_ids).name_get())
for rec in self: