diff --git a/README.md b/README.md index 91f0d2651..f00d163f4 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,8 @@ addon | version | maintainers | summary --- | --- | --- | --- [asterisk_click2dial](asterisk_click2dial/) | 16.0.1.0.0 | [![alexis-via](https://github.com/alexis-via.png?size=30px)](https://github.com/alexis-via) | Asterisk-Odoo connector [base_phone](base_phone/) | 16.0.1.0.0 | [![alexis-via](https://github.com/alexis-via.png?size=30px)](https://github.com/alexis-via) | Validate phone numbers +[hr_phone](hr_phone/) | 16.0.1.0.0 | [![alexis-via](https://github.com/alexis-via.png?size=30px)](https://github.com/alexis-via) | Validate phone numbers in HR +[hr_recruitment_phone](hr_recruitment_phone/) | 16.0.1.0.0 | [![alexis-via](https://github.com/alexis-via.png?size=30px)](https://github.com/alexis-via) | Validate phone numbers in HR Recruitment [//]: # (end addons) diff --git a/hr_phone/README.rst b/hr_phone/README.rst new file mode 100644 index 000000000..aecc0949b --- /dev/null +++ b/hr_phone/README.rst @@ -0,0 +1,85 @@ +======== +HR Phone +======== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:b0f180243908899cb6be2a3bcd701ddb262d7030d54ba011e400a50b7868eaa2 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :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/16.0/hr_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-16-0/connector-telephony-16-0-hr_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=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module validates phone numbers in the Employee form, just like the *phone_validation* +module valide phone numbers in the Partner form. It also adds phone number lookup on employees on incoming calls. + +**Table of contents** + +.. contents:: + :local: + +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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Akretion + +Contributors +~~~~~~~~~~~~ + +* Alexis de Lattre + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +.. |maintainer-alexis-via| image:: https://github.com/alexis-via.png?size=40px + :target: https://github.com/alexis-via + :alt: alexis-via + +Current `maintainer `__: + +|maintainer-alexis-via| + +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_phone/__init__.py b/hr_phone/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/hr_phone/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/hr_phone/__manifest__.py b/hr_phone/__manifest__.py new file mode 100644 index 000000000..1c0f0dec5 --- /dev/null +++ b/hr_phone/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright 2014-2021 Akretion France (http://www.akretion.com/) +# @author: Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "HR Phone", + "version": "16.0.1.0.0", + "category": "Phone", + "license": "AGPL-3", + "summary": "Validate phone numbers in HR", + "author": "Akretion,Odoo Community Association (OCA)", + "maintainers": ["alexis-via"], + "website": "https://github.com/OCA/connector-telephony", + "depends": ["base_phone", "hr"], + "data": ["security/ir.model.access.csv"], + "installable": True, + "auto_install": True, +} diff --git a/hr_phone/i18n/es.po b/hr_phone/i18n/es.po new file mode 100644 index 000000000..3908baf1b --- /dev/null +++ b/hr_phone/i18n/es.po @@ -0,0 +1,34 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_phone +# +# Translators: +# enjolras , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-02-10 01:40+0000\n" +"PO-Revision-Date: 2023-12-20 19:33+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: hr_phone +#: model:ir.model,name:hr_phone.model_hr_employee +msgid "Employee" +msgstr "Empleado" + +#~ msgid "Display Name" +#~ msgstr "Mostrar Nombre" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Última actualización el" diff --git a/hr_phone/i18n/hr_phone.pot b/hr_phone/i18n/hr_phone.pot new file mode 100644 index 000000000..37e845604 --- /dev/null +++ b/hr_phone/i18n/hr_phone.pot @@ -0,0 +1,19 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_phone +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: hr_phone +#: model:ir.model,name:hr_phone.model_hr_employee +msgid "Employee" +msgstr "" diff --git a/hr_phone/i18n/it.po b/hr_phone/i18n/it.po new file mode 100644 index 000000000..507c74ce9 --- /dev/null +++ b/hr_phone/i18n/it.po @@ -0,0 +1,20 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_phone +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" + +#. module: hr_phone +#: model:ir.model,name:hr_phone.model_hr_employee +msgid "Employee" +msgstr "" diff --git a/hr_phone/i18n/tr.po b/hr_phone/i18n/tr.po new file mode 100644 index 000000000..0b7823c2b --- /dev/null +++ b/hr_phone/i18n/tr.po @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_phone +# +# Translators: +# Ediz Duman , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-05-01 16:29+0000\n" +"PO-Revision-Date: 2017-05-01 16:29+0000\n" +"Last-Translator: Ediz Duman , 2017\n" +"Language-Team: Turkish (https://www.transifex.com/oca/teams/23907/tr/)\n" +"Language: tr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: hr_phone +#: model:ir.model,name:hr_phone.model_hr_employee +msgid "Employee" +msgstr "Personel" diff --git a/hr_phone/models/__init__.py b/hr_phone/models/__init__.py new file mode 100644 index 000000000..e11a62f98 --- /dev/null +++ b/hr_phone/models/__init__.py @@ -0,0 +1 @@ +from . import hr_employee diff --git a/hr_phone/models/hr_employee.py b/hr_phone/models/hr_employee.py new file mode 100644 index 000000000..906660da0 --- /dev/null +++ b/hr_phone/models/hr_employee.py @@ -0,0 +1,56 @@ +# Copyright 2012-2021 Akretion France (http://www.akretion.com/) +# @author: Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, models + +# phone_validation is not officially in the depends of hr, but we would like +# to have the formatting available in hr, not in event_sms -> do a conditional +# import just to be sure +try: + from odoo.addons.phone_validation.tools.phone_validation import phone_format +except ImportError: + + def phone_format( + number, + country_code, + country_phone_code, + force_format="INTERNATIONAL", + raise_exception=True, + ): + return number + + +class HrEmployeePrivate(models.Model): + _name = "hr.employee" + _inherit = ["hr.employee"] + _phone_name_sequence = 30 + _phone_name_fields = ["mobile_phone"] + # work_phone is now a computed field that take the value address_id.phone + # Don't put emergency_phone in _phone_name_fields because it is not a phone + # number of the employee + + def _phone_format(self, number, country=None): + """Call phone_validation formatting tool function. Returns original + number in case formatting cannot be done (no country, wrong info, ...)""" + if not number or not country: + return number + new_number = phone_format( + number, + country.code, + country.phone_code, + force_format="E164", + raise_exception=False, + ) + return new_number if new_number else number + + @api.onchange("mobile_phone") + def mobile_phone_change(self): + if self.mobile_phone: + country = self.env.company.country_id + self.mobile_phone = self._phone_format(self.mobile_phone, country) + + @api.onchange("emergency_phone") + def emergency_phone_change(self): + if self.emergency_phone: + self.emergency_phone = self._phone_format(self.emergency_phone) diff --git a/hr_phone/readme/CONTRIBUTORS.rst b/hr_phone/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..ff65d68ce --- /dev/null +++ b/hr_phone/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Alexis de Lattre diff --git a/hr_phone/readme/DESCRIPTION.rst b/hr_phone/readme/DESCRIPTION.rst new file mode 100644 index 000000000..9a24ba161 --- /dev/null +++ b/hr_phone/readme/DESCRIPTION.rst @@ -0,0 +1,2 @@ +This module validates phone numbers in the Employee form, just like the *phone_validation* +module valide phone numbers in the Partner form. It also adds phone number lookup on employees on incoming calls. diff --git a/hr_phone/security/ir.model.access.csv b/hr_phone/security/ir.model.access.csv new file mode 100644 index 000000000..610ef2952 --- /dev/null +++ b/hr_phone/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +callerid_hr_employee_read,Read access on hr.employee,hr.model_hr_employee,base_phone.group_callerid,1,0,0,0 diff --git a/hr_phone/static/description/icon.png b/hr_phone/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/hr_phone/static/description/icon.png differ diff --git a/hr_phone/static/description/index.html b/hr_phone/static/description/index.html new file mode 100644 index 000000000..b67f71a66 --- /dev/null +++ b/hr_phone/static/description/index.html @@ -0,0 +1,424 @@ + + + + + + +HR Phone + + + +
+

HR Phone

+ + +

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

+

This module validates phone numbers in the Employee form, just like the phone_validation +module valide phone numbers in the Partner form. It also adds phone number lookup on employees on incoming calls.

+

Table of contents

+ +
+

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.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Akretion
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

Current maintainer:

+

alexis-via

+

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_phone/tests/__init__.py b/hr_phone/tests/__init__.py new file mode 100644 index 000000000..63a956189 --- /dev/null +++ b/hr_phone/tests/__init__.py @@ -0,0 +1 @@ +from . import test_phone diff --git a/hr_phone/tests/test_phone.py b/hr_phone/tests/test_phone.py new file mode 100644 index 000000000..306ae294b --- /dev/null +++ b/hr_phone/tests/test_phone.py @@ -0,0 +1,25 @@ +# Copyright 2021 Akretion France (http://www.akretion.com/) +# @author: Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo.tests.common import TransactionCase + + +class TestEventPhone(TransactionCase): + def setUp(self): + super().setUp() + 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.employee"].create( + {"name": "Alexis de Lattre", "mobile_phone": "+33 6 78 72 72 72"} + ) + + def test_lookup(self): + res = self.phco.get_record_from_phone_number("0678727272") + self.assertIsInstance(res, tuple) + self.assertEqual(res[0], "res.partner") + self.assertEqual(res[1], self.test_record.work_contact_id.id) + self.assertEqual( + res[2], self.test_record.with_context(callerid=True).name_get()[0][1] + ) diff --git a/hr_recruitment_phone/README.rst b/hr_recruitment_phone/README.rst new file mode 100644 index 000000000..7ced9a9c6 --- /dev/null +++ b/hr_recruitment_phone/README.rst @@ -0,0 +1,85 @@ +==================== +HR Recruitment Phone +==================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:1a12acc7def0f216ab639594ac382e42d9e58af927170d661f49178228f0f4d8 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :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/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-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=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +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** + +.. contents:: + :local: + +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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Akretion + +Contributors +~~~~~~~~~~~~ + +* Alexis de Lattre + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +.. |maintainer-alexis-via| image:: https://github.com/alexis-via.png?size=40px + :target: https://github.com/alexis-via + :alt: alexis-via + +Current `maintainer `__: + +|maintainer-alexis-via| + +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/__init__.py b/hr_recruitment_phone/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/hr_recruitment_phone/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/hr_recruitment_phone/__manifest__.py b/hr_recruitment_phone/__manifest__.py new file mode 100644 index 000000000..e704f83df --- /dev/null +++ b/hr_recruitment_phone/__manifest__.py @@ -0,0 +1,20 @@ +# Copyright 2014-2021 Akretion France (http://www.akretion.com/) +# @author: Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "HR Recruitment Phone", + "version": "16.0.1.0.0", + "category": "Phone", + "license": "AGPL-3", + "summary": "Validate phone numbers in HR Recruitment", + "author": "Akretion,Odoo Community Association (OCA)", + "maintainers": ["alexis-via"], + "website": "https://github.com/OCA/connector-telephony", + "depends": ["base_phone", "hr_recruitment"], + "data": [ + "security/ir.model.access.csv", + ], + "installable": True, + "auto_install": True, +} diff --git a/hr_recruitment_phone/i18n/es.po b/hr_recruitment_phone/i18n/es.po new file mode 100644 index 000000000..438d36f99 --- /dev/null +++ b/hr_recruitment_phone/i18n/es.po @@ -0,0 +1,34 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_recruitment_phone +# +# Translators: +# enjolras , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-02-10 01:41+0000\n" +"PO-Revision-Date: 2023-12-20 19:33+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: hr_recruitment_phone +#: model:ir.model,name:hr_recruitment_phone.model_hr_applicant +msgid "Applicant" +msgstr "Solicitante" + +#~ msgid "Display Name" +#~ msgstr "Mostrar Nombre" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Última Modificación el" diff --git a/hr_recruitment_phone/i18n/hr_recruitment_phone.pot b/hr_recruitment_phone/i18n/hr_recruitment_phone.pot new file mode 100644 index 000000000..d348cefad --- /dev/null +++ b/hr_recruitment_phone/i18n/hr_recruitment_phone.pot @@ -0,0 +1,19 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_recruitment_phone +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: hr_recruitment_phone +#: model:ir.model,name:hr_recruitment_phone.model_hr_applicant +msgid "Applicant" +msgstr "" diff --git a/hr_recruitment_phone/i18n/it.po b/hr_recruitment_phone/i18n/it.po new file mode 100644 index 000000000..eae0b23b6 --- /dev/null +++ b/hr_recruitment_phone/i18n/it.po @@ -0,0 +1,20 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_recruitment_phone +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" + +#. module: hr_recruitment_phone +#: model:ir.model,name:hr_recruitment_phone.model_hr_applicant +msgid "Applicant" +msgstr "" diff --git a/hr_recruitment_phone/i18n/tr.po b/hr_recruitment_phone/i18n/tr.po new file mode 100644 index 000000000..3f2309875 --- /dev/null +++ b/hr_recruitment_phone/i18n/tr.po @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_recruitment_phone +# +# Translators: +# Ediz Duman , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-05-01 16:29+0000\n" +"PO-Revision-Date: 2017-05-01 16:29+0000\n" +"Last-Translator: Ediz Duman , 2017\n" +"Language-Team: Turkish (https://www.transifex.com/oca/teams/23907/tr/)\n" +"Language: tr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: hr_recruitment_phone +#: model:ir.model,name:hr_recruitment_phone.model_hr_applicant +msgid "Applicant" +msgstr "Başvuran" diff --git a/hr_recruitment_phone/models/__init__.py b/hr_recruitment_phone/models/__init__.py new file mode 100644 index 000000000..27b2d82eb --- /dev/null +++ b/hr_recruitment_phone/models/__init__.py @@ -0,0 +1 @@ +from . import hr_applicant diff --git a/hr_recruitment_phone/models/hr_applicant.py b/hr_recruitment_phone/models/hr_applicant.py new file mode 100644 index 000000000..3ea0ff8c3 --- /dev/null +++ b/hr_recruitment_phone/models/hr_applicant.py @@ -0,0 +1,37 @@ +# Copyright 2012-2021 Akretion France (http://www.akretion.com/) +# @author: Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, models + + +class HrApplicant(models.Model): + _name = "hr.applicant" + _inherit = ["hr.applicant"] + _phone_name_sequence = 50 + _phone_name_fields = ["partner_phone", "partner_mobile"] + + @api.onchange("partner_phone") + def partner_phone_change(self): + if self.partner_phone: + self.partner_phone = self.phone_format(self.partner_phone) + + @api.onchange("partner_mobile") + def partner_mobile_change(self): + if self.partner_mobile: + self.partner_mobile = self.phone_format(self.partner_mobile) + + def name_get(self): + if self._context.get("callerid"): + res = [] + for appl in self: + if appl.partner_id: + name = "%s (%s)" % (appl.partner_id.name, appl.name) + elif appl.partner_name: + name = "%s (%s)" % (appl.partner_name, appl.name) + else: + name = appl.name + res.append((appl.id, name)) + return res + else: + return super().name_get() diff --git a/hr_recruitment_phone/readme/CONTRIBUTORS.rst b/hr_recruitment_phone/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..ff65d68ce --- /dev/null +++ b/hr_recruitment_phone/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Alexis de Lattre diff --git a/hr_recruitment_phone/readme/DESCRIPTION.rst b/hr_recruitment_phone/readme/DESCRIPTION.rst new file mode 100644 index 000000000..b04e165f6 --- /dev/null +++ b/hr_recruitment_phone/readme/DESCRIPTION.rst @@ -0,0 +1,2 @@ +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. diff --git a/hr_recruitment_phone/security/ir.model.access.csv b/hr_recruitment_phone/security/ir.model.access.csv new file mode 100644 index 000000000..79cb9184c --- /dev/null +++ b/hr_recruitment_phone/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +callerid_hr_applicant_read,Read access on hr.applicant,hr_recruitment.model_hr_applicant,base_phone.group_callerid,1,0,0,0 diff --git a/hr_recruitment_phone/static/description/icon.png b/hr_recruitment_phone/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/hr_recruitment_phone/static/description/icon.png differ diff --git a/hr_recruitment_phone/static/description/index.html b/hr_recruitment_phone/static/description/index.html new file mode 100644 index 000000000..dc71d1f25 --- /dev/null +++ b/hr_recruitment_phone/static/description/index.html @@ -0,0 +1,424 @@ + + + + + + +HR Recruitment Phone + + + +
+

HR Recruitment Phone

+ + +

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

+ +
+

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.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Akretion
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

Current maintainer:

+

alexis-via

+

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/__init__.py b/hr_recruitment_phone/tests/__init__.py new file mode 100644 index 000000000..63a956189 --- /dev/null +++ b/hr_recruitment_phone/tests/__init__.py @@ -0,0 +1 @@ +from . import test_phone diff --git a/hr_recruitment_phone/tests/test_phone.py b/hr_recruitment_phone/tests/test_phone.py new file mode 100644 index 000000000..5ffc9c0b7 --- /dev/null +++ b/hr_recruitment_phone/tests/test_phone.py @@ -0,0 +1,31 @@ +# Copyright 2021 Akretion France (http://www.akretion.com/) +# @author: Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo.tests.common import TransactionCase + + +class TestRecruitmentPhone(TransactionCase): + def setUp(self): + super().setUp() + 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.partner = self.env["res.partner"].create( + { + "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("0478323232") + self.assertIsInstance(res, tuple) + self.assertEqual(res[0], "res.partner") + self.assertEqual(res[1], self.partner.id) + self.assertEqual( + 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/setup/_metapackage/VERSION.txt b/setup/_metapackage/VERSION.txt index 00cf2e898..4e41ed17b 100644 --- a/setup/_metapackage/VERSION.txt +++ b/setup/_metapackage/VERSION.txt @@ -1 +1 @@ -16.0.20240505.0 \ No newline at end of file +16.0.20240617.1 \ No newline at end of file diff --git a/setup/_metapackage/setup.py b/setup/_metapackage/setup.py index e7fe8ec45..0b888dea6 100644 --- a/setup/_metapackage/setup.py +++ b/setup/_metapackage/setup.py @@ -10,6 +10,8 @@ install_requires=[ 'odoo-addon-asterisk_click2dial>=16.0dev,<16.1dev', 'odoo-addon-base_phone>=16.0dev,<16.1dev', + 'odoo-addon-hr_phone>=16.0dev,<16.1dev', + 'odoo-addon-hr_recruitment_phone>=16.0dev,<16.1dev', ], classifiers=[ 'Programming Language :: Python', diff --git a/setup/hr_phone/odoo/addons/hr_phone b/setup/hr_phone/odoo/addons/hr_phone new file mode 120000 index 000000000..f08cc9920 --- /dev/null +++ b/setup/hr_phone/odoo/addons/hr_phone @@ -0,0 +1 @@ +../../../../hr_phone \ No newline at end of file diff --git a/setup/hr_phone/setup.py b/setup/hr_phone/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/hr_phone/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/setup/hr_recruitment_phone/odoo/addons/hr_recruitment_phone b/setup/hr_recruitment_phone/odoo/addons/hr_recruitment_phone new file mode 120000 index 000000000..8dd9c848b --- /dev/null +++ b/setup/hr_recruitment_phone/odoo/addons/hr_recruitment_phone @@ -0,0 +1 @@ +../../../../hr_recruitment_phone \ No newline at end of file diff --git a/setup/hr_recruitment_phone/setup.py b/setup/hr_recruitment_phone/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/hr_recruitment_phone/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 000000000..e69de29bb