From 3018a91eaa141d40b365e12d8fe9aad64a555ccd Mon Sep 17 00:00:00 2001 From: sofiagvaladze Date: Mon, 22 Nov 2021 20:36:34 +0000 Subject: [PATCH] [FIX] hr_recruitment: correct smart button display info It is more intuitive that application_count smartbutton has the label 'x Other applications'. task - 2695252 closes odoo/odoo#80551 X-original-commit: f1a2f51fec0a31b80a20c78a5b3d11561dce7164 Signed-off-by: Kevin Baptiste --- addons/hr_recruitment/i18n/hr_recruitment.pot | 5 +++++ addons/hr_recruitment/models/hr_recruitment.py | 2 +- addons/hr_recruitment/tests/test_recruitment.py | 6 +++--- addons/hr_recruitment/views/hr_recruitment_views.xml | 4 ++-- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/addons/hr_recruitment/i18n/hr_recruitment.pot b/addons/hr_recruitment/i18n/hr_recruitment.pot index 9732278870a..285bf62a2ff 100644 --- a/addons/hr_recruitment/i18n/hr_recruitment.pot +++ b/addons/hr_recruitment/i18n/hr_recruitment.pot @@ -1887,6 +1887,11 @@ msgstr "" msgid "Or talk about this applicant privately with your colleagues." msgstr "" +#. module: hr_recruitment +#: model_terms:ir.ui.view,arch_db:hr_recruitment.hr_applicant_view_form +msgid "Other applications" +msgstr "" + #. module: hr_recruitment #: model:ir.model.fields,field_description:hr_recruitment.field_hr_job__alias_user_id msgid "Owner" diff --git a/addons/hr_recruitment/models/hr_recruitment.py b/addons/hr_recruitment/models/hr_recruitment.py index bdd934eabcd..36dc5757aef 100644 --- a/addons/hr_recruitment/models/hr_recruitment.py +++ b/addons/hr_recruitment/models/hr_recruitment.py @@ -229,7 +229,7 @@ class Applicant(models.Model): else: application_data_mapped = dict() for applicant in applicants: - applicant.application_count = application_data_mapped.get(applicant.email_from.lower(), 1) + applicant.application_count = application_data_mapped.get(applicant.email_from.lower(), 1) - 1 (self - applicants).application_count = False @api.depends_context('lang') diff --git a/addons/hr_recruitment/tests/test_recruitment.py b/addons/hr_recruitment/tests/test_recruitment.py index 5baa7c3fd7f..c25efc978b6 100644 --- a/addons/hr_recruitment/tests/test_recruitment.py +++ b/addons/hr_recruitment/tests/test_recruitment.py @@ -23,6 +23,6 @@ class TestRecruitment(TransactionCase): 'email_from': 'laure.poiret@aol.ru', }, ]) - self.assertEqual(dup1.application_count, 2) - self.assertEqual(dup2.application_count, 2) - self.assertEqual(no_dup.application_count, 1) + self.assertEqual(dup1.application_count, 1) + self.assertEqual(dup2.application_count, 1) + self.assertEqual(no_dup.application_count, 0) diff --git a/addons/hr_recruitment/views/hr_recruitment_views.xml b/addons/hr_recruitment/views/hr_recruitment_views.xml index 02e98b291b3..18d21fadb3a 100644 --- a/addons/hr_recruitment/views/hr_recruitment_views.xml +++ b/addons/hr_recruitment/views/hr_recruitment_views.xml @@ -86,8 +86,8 @@ icon="fa-pencil" type="object" context="{'active_test': False}" - attrs="{'invisible': [('application_count', '<' , 2)]}"> - + attrs="{'invisible': [('application_count', '=' , 0)]}"> +