From 6a1e1bc16644f2df4566863f76862342b1bb8855 Mon Sep 17 00:00:00 2001 From: Nikul-OSI Date: Mon, 12 Feb 2024 10:24:48 +0530 Subject: [PATCH] [IMP] base_phone: pre-commit stuff --- base_phone/README.rst | 36 +++++++++++++++--------- base_phone/__manifest__.py | 2 +- base_phone/models/phone_common.py | 5 ++-- base_phone/models/res_partner.py | 2 +- base_phone/readme/CONTRIBUTORS.rst | 2 -- base_phone/readme/DESCRIPTION.rst | 6 ---- base_phone/static/description/index.html | 22 ++++++++++----- base_phone/tests/test_base_phone.py | 2 +- 8 files changed, 43 insertions(+), 34 deletions(-) delete mode 100644 base_phone/readme/CONTRIBUTORS.rst delete mode 100644 base_phone/readme/DESCRIPTION.rst diff --git a/base_phone/README.rst b/base_phone/README.rst index 808f0f202..1abb71f93 100644 --- a/base_phone/README.rst +++ b/base_phone/README.rst @@ -17,21 +17,29 @@ Base 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/base_phone + :target: https://github.com/OCA/connector-telephony/tree/17.0/base_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-base_phone + :target: https://translation.odoo-community.org/projects/connector-telephony-17-0/connector-telephony-17-0-base_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=17.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| -This module provides common methods and wizards which can be useful to develop a connector between Odoo and a telephony system. It depends on the official module *phone_validation* which handle the reformatting of phone numbers using the `phonenumbers `_ Python library, which is a port of the library used in Android smartphones. For example, if -your user is linked to a French company and you update the form view of a -partner with a badly written French phone number such as '01-55-42-12-42', -Odoo will automatically update the phone number to `E.164 `_ format '+33155421242'. This module extends this reformatting to create() and write() methods. +This module provides common methods and wizards which can be useful to +develop a connector between Odoo and a telephony system. It depends on +the official module *phone_validation* which handle the reformatting of +phone numbers using the +`phonenumbers `__ +Python library, which is a port of the library used in Android +smartphones. For example, if your user is linked to a French company and +you update the form view of a partner with a badly written French phone +number such as '01-55-42-12-42', Odoo will automatically update the +phone number to `E.164 `__ format +'+33155421242'. This module extends this reformatting to create() and +write() methods. This module is used by the Odoo-Asterisk connector of the OCA. @@ -46,7 +54,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. @@ -54,18 +62,18 @@ Credits ======= Authors -~~~~~~~ +------- * Akretion Contributors -~~~~~~~~~~~~ +------------ -* Alexis de Lattre -* Sébastien Beau +- Alexis de Lattre +- Sébastien Beau Maintainers -~~~~~~~~~~~ +----------- This module is maintained by the OCA. @@ -85,6 +93,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/base_phone/__manifest__.py b/base_phone/__manifest__.py index b013d093c..7f6c25bad 100644 --- a/base_phone/__manifest__.py +++ b/base_phone/__manifest__.py @@ -5,7 +5,7 @@ { "name": "Base Phone", - "version": "14.0.1.0.0", + "version": "17.0.1.0.0", "category": "Phone", "license": "AGPL-3", "summary": "Validate phone numbers", diff --git a/base_phone/models/phone_common.py b/base_phone/models/phone_common.py index 9b637dc73..5d8d88f1d 100644 --- a/base_phone/models/phone_common.py +++ b/base_phone/models/phone_common.py @@ -38,8 +38,9 @@ def get_record_from_phone_number(self, presented_number): ) if not isinstance(presented_number, str): _logger.warning( - "Number '%s' should be a 'str' but it is a '%s'" - % (presented_number, type(presented_number)) + ("Number '{}' should be a 'str' but it is a '{}'").formate( + presented_number, type(presented_number) + ) ) return False if not presented_number.isdigit(): diff --git a/base_phone/models/res_partner.py b/base_phone/models/res_partner.py index c38901ff6..4b4c7908f 100644 --- a/base_phone/models/res_partner.py +++ b/base_phone/models/res_partner.py @@ -20,7 +20,7 @@ def name_get(self): res = [] for partner in self: if partner.parent_id and partner.parent_id.is_company: - name = "{}, {}".format(partner.parent_id.name, partner.name) + name = f"{partner.parent_id.name}, {partner.name}" else: name = partner.name res.append((partner.id, name)) diff --git a/base_phone/readme/CONTRIBUTORS.rst b/base_phone/readme/CONTRIBUTORS.rst deleted file mode 100644 index 929705395..000000000 --- a/base_phone/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1,2 +0,0 @@ -* Alexis de Lattre -* Sébastien Beau diff --git a/base_phone/readme/DESCRIPTION.rst b/base_phone/readme/DESCRIPTION.rst deleted file mode 100644 index 37315b953..000000000 --- a/base_phone/readme/DESCRIPTION.rst +++ /dev/null @@ -1,6 +0,0 @@ -This module provides common methods and wizards which can be useful to develop a connector between Odoo and a telephony system. It depends on the official module *phone_validation* which handle the reformatting of phone numbers using the `phonenumbers `_ Python library, which is a port of the library used in Android smartphones. For example, if -your user is linked to a French company and you update the form view of a -partner with a badly written French phone number such as '01-55-42-12-42', -Odoo will automatically update the phone number to `E.164 `_ format '+33155421242'. This module extends this reformatting to create() and write() methods. - -This module is used by the Odoo-Asterisk connector of the OCA. diff --git a/base_phone/static/description/index.html b/base_phone/static/description/index.html index 18c2d3d0b..3b759aae4 100644 --- a/base_phone/static/description/index.html +++ b/base_phone/static/description/index.html @@ -369,11 +369,19 @@

Base Phone

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:9f25b9cb743d588b4cbe67f7804ef3aa733902d373f0108b0a1a97f5ac72d0a7 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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

-

This module provides common methods and wizards which can be useful to develop a connector between Odoo and a telephony system. It depends on the official module phone_validation which handle the reformatting of phone numbers using the phonenumbers Python library, which is a port of the library used in Android smartphones. For example, if -your user is linked to a French company and you update the form view of a -partner with a badly written French phone number such as ‘01-55-42-12-42’, -Odoo will automatically update the phone number to E.164 format ‘+33155421242’. This module extends this reformatting to create() and write() methods.

+

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

+

This module provides common methods and wizards which can be useful to +develop a connector between Odoo and a telephony system. It depends on +the official module phone_validation which handle the reformatting of +phone numbers using the +phonenumbers +Python library, which is a port of the library used in Android +smartphones. For example, if your user is linked to a French company and +you update the form view of a partner with a badly written French phone +number such as ‘01-55-42-12-42’, Odoo will automatically update the +phone number to E.164 format +‘+33155421242’. This module extends this reformatting to create() and +write() methods.

This module is used by the Odoo-Asterisk connector of the OCA.

Table of contents

@@ -392,7 +400,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.

@@ -419,7 +427,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/base_phone/tests/test_base_phone.py b/base_phone/tests/test_base_phone.py index 738ad3a96..849e6729d 100644 --- a/base_phone/tests/test_base_phone.py +++ b/base_phone/tests/test_base_phone.py @@ -7,7 +7,7 @@ class TestBasePhone(TransactionCase): def setUp(self): - super(TestBasePhone, self).setUp() + 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})