From c2d9c55ee8729682f0b9702fabce9f1973817d4b Mon Sep 17 00:00:00 2001 From: ravb-odoo Date: Tue, 23 Jan 2024 06:06:20 +0000 Subject: [PATCH] [FIX] hr_recruitment: fix document uploading from applicant Description of the issue/feature this PR addresses: In the kanban view of all applicants within the recruitment module, an issue arises when applicants attempt to upload documents. Current behavior before PR: upload button is hidden while uncheck the settings from Documents for Recruitment. Desired behavior after PR is merged: upload button is visible while uncheck the settings from Documents for Recruitment. Fix: The PR addresses the problem by modifying tree view of ir.attachment and default_res_model in the context. This adjustment is crucial as the current setting results in an incorrect model name, preventing the display of uploaded documents in this model. task-3579833 closes odoo/odoo#155958 X-original-commit: 0bd4a6ed4732156ab37bc555ea5228ca752dfced Related: odoo/enterprise#57840 Signed-off-by: Sofie Gvaladze (sgv) --- addons/hr_recruitment/models/hr_applicant.py | 2 +- addons/hr_recruitment/views/ir_attachment_views.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/hr_recruitment/models/hr_applicant.py b/addons/hr_recruitment/models/hr_applicant.py index 8db3977864d..3d7fe3c4cf0 100644 --- a/addons/hr_recruitment/models/hr_applicant.py +++ b/addons/hr_recruitment/models/hr_applicant.py @@ -500,7 +500,7 @@ class Applicant(models.Model): 'res_model': 'ir.attachment', 'name': _('Documents'), 'context': { - 'default_res_model': 'hr.job', + 'default_res_model': 'hr.applicant', 'default_res_id': self.ids[0], 'show_partner_name': 1, }, diff --git a/addons/hr_recruitment/views/ir_attachment_views.xml b/addons/hr_recruitment/views/ir_attachment_views.xml index 6229b39c63e..fafc6e34e17 100644 --- a/addons/hr_recruitment/views/ir_attachment_views.xml +++ b/addons/hr_recruitment/views/ir_attachment_views.xml @@ -27,7 +27,7 @@ ir.attachment primary - +