From 17dc4e5e7ebf9761ae281c2948aef5f7cdbcba99 Mon Sep 17 00:00:00 2001 From: PauBForgeFlow Date: Wed, 3 Jan 2024 08:42:18 +0100 Subject: [PATCH] [MIG] hr_recruitment_phone: Migration to 16.0 --- hr_recruitment_phone/README.rst | 12 ++++++------ hr_recruitment_phone/__manifest__.py | 2 +- hr_recruitment_phone/models/hr_applicant.py | 2 +- .../static/description/index.html | 8 ++++---- hr_recruitment_phone/tests/test_phone.py | 18 ++++++++++-------- test-requirements.txt | 0 6 files changed, 22 insertions(+), 20 deletions(-) create mode 100644 test-requirements.txt diff --git a/hr_recruitment_phone/README.rst b/hr_recruitment_phone/README.rst index 6c432bb7d..7ced9a9c6 100644 --- a/hr_recruitment_phone/README.rst +++ b/hr_recruitment_phone/README.rst @@ -7,7 +7,7 @@ HR Recruitment Phone !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:d2edef1508138114b005bad7a0ffa11e3a55a0d2a780aaebc1f89d9de5b4f9b6 + !! source digest: sha256:1a12acc7def0f216ab639594ac382e42d9e58af927170d661f49178228f0f4d8 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png @@ -17,13 +17,13 @@ HR Recruitment Phone :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fconnector--telephony-lightgray.png?logo=github - :target: https://github.com/OCA/connector-telephony/tree/14.0/hr_recruitment_phone + :target: https://github.com/OCA/connector-telephony/tree/16.0/hr_recruitment_phone :alt: OCA/connector-telephony .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/connector-telephony-14-0/connector-telephony-14-0-hr_recruitment_phone + :target: https://translation.odoo-community.org/projects/connector-telephony-16-0/connector-telephony-16-0-hr_recruitment_phone :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png - :target: https://runboat.odoo-community.org/builds?repo=OCA/connector-telephony&target_branch=14.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/connector-telephony&target_branch=16.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -42,7 +42,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -80,6 +80,6 @@ Current `maintainer `__: |maintainer-alexis-via| -This module is part of the `OCA/connector-telephony `_ project on GitHub. +This module is part of the `OCA/connector-telephony `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/hr_recruitment_phone/__manifest__.py b/hr_recruitment_phone/__manifest__.py index cfc114998..e704f83df 100644 --- a/hr_recruitment_phone/__manifest__.py +++ b/hr_recruitment_phone/__manifest__.py @@ -4,7 +4,7 @@ { "name": "HR Recruitment Phone", - "version": "14.0.1.0.0", + "version": "16.0.1.0.0", "category": "Phone", "license": "AGPL-3", "summary": "Validate phone numbers in HR Recruitment", diff --git a/hr_recruitment_phone/models/hr_applicant.py b/hr_recruitment_phone/models/hr_applicant.py index f090be1d0..3ea0ff8c3 100644 --- a/hr_recruitment_phone/models/hr_applicant.py +++ b/hr_recruitment_phone/models/hr_applicant.py @@ -7,7 +7,7 @@ class HrApplicant(models.Model): _name = "hr.applicant" - _inherit = ["hr.applicant", "phone.validation.mixin"] + _inherit = ["hr.applicant"] _phone_name_sequence = 50 _phone_name_fields = ["partner_phone", "partner_mobile"] diff --git a/hr_recruitment_phone/static/description/index.html b/hr_recruitment_phone/static/description/index.html index 1171241ef..dc71d1f25 100644 --- a/hr_recruitment_phone/static/description/index.html +++ b/hr_recruitment_phone/static/description/index.html @@ -367,9 +367,9 @@

HR Recruitment Phone

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:d2edef1508138114b005bad7a0ffa11e3a55a0d2a780aaebc1f89d9de5b4f9b6 +!! source digest: sha256:1a12acc7def0f216ab639594ac382e42d9e58af927170d661f49178228f0f4d8 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/connector-telephony Translate me on Weblate Try me on Runboat

+

Beta License: AGPL-3 OCA/connector-telephony Translate me on Weblate Try me on Runboat

This module validates phone numbers in the Applicant form of the Recruitment module, just like the phone_validation module valide phone numbers in the Partner form. It also adds phone number lookup on applicants on incoming calls.

Table of contents

@@ -389,7 +389,7 @@

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -feedback.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -415,7 +415,7 @@

Maintainers

promote its widespread use.

Current maintainer:

alexis-via

-

This module is part of the OCA/connector-telephony project on GitHub.

+

This module is part of the OCA/connector-telephony project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

diff --git a/hr_recruitment_phone/tests/test_phone.py b/hr_recruitment_phone/tests/test_phone.py index d6226e5fb..5ffc9c0b7 100644 --- a/hr_recruitment_phone/tests/test_phone.py +++ b/hr_recruitment_phone/tests/test_phone.py @@ -11,19 +11,21 @@ def setUp(self): self.fr_country_id = self.env.ref("base.fr").id self.phco = self.env["phone.common"] self.env.company.write({"country_id": self.fr_country_id}) - self.test_record = self.env["hr.applicant"].create( + self.partner = self.env["res.partner"].create( { - "name": "Expert Odoo", - "partner_name": "Alexis de Lattre", - "partner_phone": "+33 4 78 52 52 52", + "name": "Partner 0", + "country_id": self.fr_country_id, + "phone": "+33 4 78 32 32 32", } ) def test_lookup(self): - res = self.phco.get_record_from_phone_number("0478525252") + res = self.phco.get_record_from_phone_number("0478323232") self.assertIsInstance(res, tuple) - self.assertEqual(res[0], "hr.applicant") - self.assertEqual(res[1], self.test_record.id) + self.assertEqual(res[0], "res.partner") + self.assertEqual(res[1], self.partner.id) self.assertEqual( - res[2], self.test_record.with_context(callerid=True).name_get()[0][1] + res[2], self.partner.with_context(callerid=True).name_get()[0][1] ) + res = self.phco.get_record_from_phone_number("0499889988") + self.assertFalse(res) diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 000000000..e69de29bb