Skip to content

Commit

Permalink
[FIX] hr_recruitment: be able to see archived applications
Browse files Browse the repository at this point in the history
- create 2 applications in Odoo Recruitments with the same email
- Notice how they both have a stat button that indicates that this
applicant has another application.
- Refuse one of the 2 applications

The stat button disappear because it ignores archived records, while it
should indicate if someone has already applied in the past

opw-2423158

closes odoo#63926

X-original-commit: caaef58
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
  • Loading branch information
agr-odoo committed Dec 30, 2020
1 parent b3a23aa commit 63e8c30
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion addons/hr_recruitment/models/hr_recruitment.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def _compute_day(self):

@api.depends('email_from')
def _compute_application_count(self):
application_data = self.env['hr.applicant'].read_group([
application_data = self.env['hr.applicant'].with_context(active_test=False).read_group([
('email_from', 'in', list(set(self.mapped('email_from'))))], ['email_from'], ['email_from'])
application_data_mapped = dict((data['email_from'], data['email_from_count']) for data in application_data)
applicants = self.filtered(lambda applicant: applicant.email_from)
Expand Down
1 change: 1 addition & 0 deletions addons/hr_recruitment/views/hr_recruitment_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
class="oe_stat_button"
icon="fa-pencil"
type="object"
context="{'active_test': False}"
attrs="{'invisible': [('application_count', '=', 0)]}">
<field name="application_count" widget="statinfo" string="Other Applications"/>
</button>
Expand Down

0 comments on commit 63e8c30

Please sign in to comment.