fix preview

This commit is contained in:
raman 2025-04-18 12:32:11 +05:30
parent 2e53ada2f3
commit be0cbc33bb
3 changed files with 3 additions and 3 deletions

View File

@ -142,7 +142,7 @@ class HRApplicant(models.Model):
for rec in self: for rec in self:
if rec.resume: if rec.resume:
attachment = self.env.ref("hr_recruitment_extended.employee_recruitment_attachments_preview") attachment = self.env.ref("hr_recruitment_extended.employee_recruitment_attachments_preview")
file = attachment.write({ file = attachment.sudo().write({
'datas': rec.resume, 'datas': rec.resume,
}) })
if file: if file:

View File

@ -39,7 +39,7 @@ class HrCandidate(models.Model):
for rec in self: for rec in self:
if rec.resume: if rec.resume:
attachment = self.env.ref("hr_recruitment_extended.employee_recruitment_attachments_preview") attachment = self.env.ref("hr_recruitment_extended.employee_recruitment_attachments_preview")
file = attachment.write({ file = attachment.sudo().write({
'datas':rec.resume, 'datas':rec.resume,
}) })
if file: if file:

View File

@ -30,7 +30,7 @@ class EmployeeRecruitmentAttachments(models.Model):
for record in self: for record in self:
if record.file: if record.file:
attachment = self.env.ref("hr_recruitment_extended.employee_recruitment_attachments_preview") attachment = self.env.ref("hr_recruitment_extended.employee_recruitment_attachments_preview")
attachment.datas = record.file attachment.sudo().datas = record.file
return { return {
'name': "File Preview", 'name': "File Preview",
'type': 'ir.actions.act_url', 'type': 'ir.actions.act_url',