[IMP] hr_recruitment_skills: Remove Populate button on search view modif

Purpose
=======

It becomes unclear what the button does once the search view doesn't
filter on the related job's applications (aka the filter is removed
for example)

Taskid: 2884356
Part-of: odoo/odoo#93684
This commit is contained in:
Yannick Tivisse
2022-06-16 11:25:02 +02:00
parent bf72044b07
commit 6faad54a2f
2 changed files with 19 additions and 1 deletions
@@ -26,6 +26,24 @@ odoo.define('hr.applicant.view.kanban', function (require) {
}
});
});
},
_onSearch: async function (searchQuery) {
this._super.apply(this, arguments);
var activeID = this.model.get(this.handle).context.active_id;
var jobID = undefined;
if (searchQuery.domain && !_.isEmpty(searchQuery.domain)) {
searchQuery.domain.forEach(elem => {
if (elem.length === 3 && elem[0] === 'job_id') {
jobID = elem[2];
}
})
}
if (activeID === jobID) {
$('button.o_button_recruitment_populate').removeClass('d-none');
} else {
$('button.o_button_recruitment_populate').addClass('d-none');
}
}
});
@@ -23,7 +23,7 @@
</sheet>
<footer>
<button string="Populate" name="action_validate" type="object" class="btn-primary"/>
<button special="cancel" string="Close" type="object" class="btn-primary"/>
<button special="cancel" string="Close" type="object" class="btn-secondary"/>
</footer>
</form>
</field>