[FIX] website_hr_recruitment: Allow users to apply form
Steps: - Install `website_hr_recruitment` - Try to add a file in `Resume` - Click on Apply A traceback is raised because we use `.val()` instead of `files.length` to check if the user has uploaded closes odoo/odoo#145008 Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
This commit is contained in:
@@ -23,15 +23,15 @@ publicWidget.registry.hrRecruitment = publicWidget.Widget.extend({
|
||||
},
|
||||
|
||||
_onClickApplyButton (ev) {
|
||||
const linkedin_profile = $('#recruitment4').val();
|
||||
const resume = $('#recruitment6').val();
|
||||
if (linkedin_profile.trim() === '' &&
|
||||
resume.trim() === '') {
|
||||
$('#recruitment4').attr('required', true);
|
||||
$('#recruitment6').attr('required', true);
|
||||
const $linkedin_profile = $('#recruitment4');
|
||||
const $resume = $('#recruitment6');
|
||||
if ($linkedin_profile.val().trim() === '' &&
|
||||
!$resume[0].files.length) {
|
||||
$linkedin_profile.attr('required', true);
|
||||
$resume.attr('required', true);
|
||||
} else {
|
||||
$('#recruitment4').attr('required', false);
|
||||
$('#recruitment6').attr('required', false);
|
||||
$linkedin_profile.attr('required', false);
|
||||
$resume.attr('required', false);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user