summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Grazioso (agr-odoo) <agr@odoo.com>2020-12-29 16:49:11 +0000
committerAndrea Grazioso (agr-odoo) <agr@odoo.com>2020-12-29 16:49:11 +0000
commitcaaef5829b51f7e5862a6d730ea978e19deadd42 (patch)
treeaf6694824da1cbf2e3cde603cbb5f6fdd7eaacf0
parentb7fa0cfad03a8319f03c1aa89eb67635e1200f67 (diff)
[FIX] hr_recruitment: be able to see archived applications
- 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/odoo#63893 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
-rw-r--r--addons/hr_recruitment/models/hr_recruitment.py2
-rw-r--r--addons/hr_recruitment/views/hr_recruitment_views.xml1
2 files changed, 2 insertions, 1 deletions
diff --git a/addons/hr_recruitment/models/hr_recruitment.py b/addons/hr_recruitment/models/hr_recruitment.py
index 4878a5e9a76..3ac06ed5da1 100644
--- a/addons/hr_recruitment/models/hr_recruitment.py
+++ b/addons/hr_recruitment/models/hr_recruitment.py
@@ -176,7 +176,7 @@ class Applicant(models.Model):
@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)
diff --git a/addons/hr_recruitment/views/hr_recruitment_views.xml b/addons/hr_recruitment/views/hr_recruitment_views.xml
index 6f9119148b5..2e39a8ae3a1 100644
--- a/addons/hr_recruitment/views/hr_recruitment_views.xml
+++ b/addons/hr_recruitment/views/hr_recruitment_views.xml
@@ -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>