Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syncing from upstream OCA/connector-telephony (16.0) #176

Merged
merged 74 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
67a8d32
Very large changes in the structure of the project :
Jul 27, 2014
1b0f461
5 modules are now in auto_install mode
Aug 29, 2014
92f5c7a
Fix code style
Nov 5, 2014
e396926
Add widget="phone" in tree view, to have an easy-to-read phone number…
Dec 16, 2014
af639b9
Add OCA as author of OCA addons
gurneyalex Mar 2, 2015
69c322d
If you enter a phone number in national format, it is now interpreted…
Mar 20, 2015
3ac292b
More Yaml tests
Mar 20, 2015
b3e6e3d
[UPD] prefix versions with 8.0
sbidoul Oct 9, 2015
b34ed29
[MIG] Make modules uninstallable
pedrobaeza Oct 14, 2015
40bcc49
Port hr_phone to v9
alexis-via May 21, 2016
126a6ec
Port event_phone and hr_recruitment_phone to v9
alexis-via May 21, 2016
3509102
Restore the object crm.phonecall that was dropped in v9 community
alexis-via May 23, 2016
bfe8b2f
Started to implement solution d) as discussed in https://github.com/O…
alexis-via Jun 24, 2016
fa9baa7
[MIG] Make modules uninstallable
pedrobaeza Oct 6, 2016
7ffef79
[MIG] Rename manifest files
pedrobaeza Oct 6, 2016
00c08e0
Port crm_phone, hr_phone, hr_recruitment_phone, event_phone to v10
alexis-via Oct 28, 2016
9121cab
OCA Transbot updated translations from Transifex
oca-transbot Jun 17, 2017
28f653d
OCA Transbot updated translations from Transifex
oca-transbot Mar 31, 2018
04fb1a8
[UPD] Update hr_phone.pot
oca-travis Jun 23, 2018
ff3f860
Port to v12 base_phone, asterisk_click2dial, crm_phone, hr_phone, eve…
alexis-via Nov 15, 2018
18119ee
[UPD] Update hr_phone.pot
oca-travis Nov 16, 2018
f1cbb2f
[ADD] icon.png
OCA-git-bot Apr 3, 2019
2e306c2
[MIG] hr_phone from v12 to v14
alexis-via May 15, 2021
7e6a0e7
hr_phone: black, isort, ...
alexis-via May 15, 2021
20425fc
hr_phone: add unit test
alexis-via May 15, 2021
8921dba
[UPD] README.rst
OCA-git-bot Aug 1, 2021
35b797d
[UPD] Update hr_phone.pot
oca-travis Nov 26, 2021
318a5db
Update translation files
oca-transbot Nov 26, 2021
a0388d8
[UPD] README.rst
OCA-git-bot Sep 3, 2023
23a5cc7
Translated using Weblate (Spanish)
Ivorra78 Dec 20, 2023
e0d7b22
[IMP] hr_phone: pre-commit stuff
ArnauCForgeFlow Dec 22, 2023
4cc7382
Very large changes in the structure of the project :
Jul 27, 2014
dd9ecbd
5 modules are now in auto_install mode
Aug 29, 2014
1952e55
Fix code style
Nov 5, 2014
7c7fcbd
Add widget="phone" in tree view, to have an easy-to-read phone number…
Dec 16, 2014
961a1ec
Add OCA as author of OCA addons
gurneyalex Mar 2, 2015
af91c78
If you enter a phone number in national format, it is now interpreted…
Mar 20, 2015
36bb808
More Yaml tests
Mar 20, 2015
4a9e9d5
[UPD] prefix versions with 8.0
sbidoul Oct 9, 2015
ec3c4cb
[MIG] Make modules uninstallable
pedrobaeza Oct 14, 2015
f6fe20f
Port event_phone and hr_recruitment_phone to v9
alexis-via May 21, 2016
1114913
Restore the object crm.phonecall that was dropped in v9 community
alexis-via May 23, 2016
93ef275
Started to implement solution d) as discussed in https://github.com/O…
alexis-via Jun 24, 2016
420b433
[MIG] Make modules uninstallable
pedrobaeza Oct 6, 2016
70aa7ae
[MIG] Rename manifest files
pedrobaeza Oct 6, 2016
20fc90f
Port crm_phone, hr_phone, hr_recruitment_phone, event_phone to v10
alexis-via Oct 28, 2016
d11c5b6
OCA Transbot updated translations from Transifex
oca-transbot Jun 17, 2017
077a135
OCA Transbot updated translations from Transifex
oca-transbot Mar 31, 2018
5d6f3b0
[UPD] Update hr_recruitment_phone.pot
oca-travis Jun 23, 2018
d9e6825
Port to v12 base_phone, asterisk_click2dial, crm_phone, hr_phone, eve…
alexis-via Nov 15, 2018
1990fac
[UPD] Update hr_recruitment_phone.pot
oca-travis Nov 16, 2018
586913d
[ADD] icon.png
OCA-git-bot Apr 3, 2019
965bce6
Forward port dial button refactor from v11 to v12
alexis-via May 28, 2019
6665a12
[MIG] hr_recruitment_phone from v12 to v14
alexis-via May 15, 2021
8c609ef
hr_recruitment_phone: black, isort, ...
alexis-via May 15, 2021
e841120
hr_recruitment_phone: add unit test
alexis-via May 15, 2021
a608701
[UPD] README.rst
OCA-git-bot Aug 1, 2021
356cd24
[UPD] Update hr_recruitment_phone.pot
oca-travis Nov 26, 2021
122b453
Update translation files
oca-transbot Nov 26, 2021
b4507e7
[UPD] README.rst
OCA-git-bot Sep 3, 2023
279c405
Translated using Weblate (Spanish)
Ivorra78 Dec 20, 2023
d0edcad
[IMP] hr_recruitment_phone: pre-commit stuff
PauBForgeFlow Dec 29, 2023
105ad28
[MIG] hr_phone: Migration to 16.0
ArnauCForgeFlow Dec 22, 2023
17dc4e5
[MIG] hr_recruitment_phone: Migration to 16.0
PauBForgeFlow Jan 3, 2024
bae2801
Merge PR #308 into 16.0
OCA-git-bot Jun 17, 2024
ec813df
[UPD] Update hr_recruitment_phone.pot
Jun 17, 2024
14ea9cf
[BOT] post-merge updates
OCA-git-bot Jun 17, 2024
9c50549
Merge PR #307 into 16.0
OCA-git-bot Jun 17, 2024
7f75f06
[UPD] Update hr_phone.pot
Jun 17, 2024
e08e51d
[BOT] post-merge updates
OCA-git-bot Jun 17, 2024
6283d6a
Update translation files
weblate Jun 17, 2024
f56f0ef
Update translation files
weblate Jun 17, 2024
4d24ffd
Added translation using Weblate (Italian)
mymage Jun 17, 2024
3b43b57
Added translation using Weblate (Italian)
mymage Jun 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
85 changes: 85 additions & 0 deletions hr_phone/README.rst
Original file line number Diff line number Diff line change
@@ -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 <https://github.com/OCA/connector-telephony/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 <https://github.com/OCA/connector-telephony/issues/new?body=module:%20hr_phone%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
~~~~~~~

* Akretion

Contributors
~~~~~~~~~~~~

* Alexis de Lattre <[email protected]>

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 <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-alexis-via|

This module is part of the `OCA/connector-telephony <https://github.com/OCA/connector-telephony/tree/16.0/hr_phone>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions hr_phone/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
18 changes: 18 additions & 0 deletions hr_phone/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2014-2021 Akretion France (http://www.akretion.com/)
# @author: Alexis de Lattre <[email protected]>
# 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,
}
34 changes: 34 additions & 0 deletions hr_phone/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_phone
#
# Translators:
# enjolras <[email protected]>, 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 <[email protected]>\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"
19 changes: 19 additions & 0 deletions hr_phone/i18n/hr_phone.pot
Original file line number Diff line number Diff line change
@@ -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 ""
20 changes: 20 additions & 0 deletions hr_phone/i18n/it.po
Original file line number Diff line number Diff line change
@@ -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 ""
24 changes: 24 additions & 0 deletions hr_phone/i18n/tr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_phone
#
# Translators:
# Ediz Duman <[email protected]>, 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 <[email protected]>, 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"
1 change: 1 addition & 0 deletions hr_phone/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import hr_employee
56 changes: 56 additions & 0 deletions hr_phone/models/hr_employee.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Copyright 2012-2021 Akretion France (http://www.akretion.com/)
# @author: Alexis de Lattre <[email protected]>
# 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)
1 change: 1 addition & 0 deletions hr_phone/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Alexis de Lattre <[email protected]>
2 changes: 2 additions & 0 deletions hr_phone/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 2 additions & 0 deletions hr_phone/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -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
Binary file added hr_phone/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading