You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
3.2 KiB

10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
  1. # -*- encoding: utf-8 -*-
  2. ##############################################################################
  3. #
  4. # Base Phone module for OpenERP
  5. # Copyright (C) 2014 Alexis de Lattre <alexis@via.ecp.fr>
  6. #
  7. # This program is free software: you can redistribute it and/or modify
  8. # it under the terms of the GNU Affero General Public License as
  9. # published by the Free Software Foundation, either version 3 of the
  10. # License, or (at your option) any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU Affero General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU Affero General Public License
  18. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. #
  20. ##############################################################################
  21. {
  22. 'name': 'Base Phone',
  23. 'version': '0.1',
  24. 'category': 'Phone',
  25. 'license': 'AGPL-3',
  26. 'summary': 'Validate phone numbers',
  27. 'description': """
  28. Base Phone
  29. ==========
  30. This module validate phone numbers using the *phonenumbers* Python library,
  31. which is a port of the library used in Android smartphones. For example, if
  32. your user is linked to a French company and you update the form view of a
  33. partner with a badly written French phone number such as '01-55-42-12-42',
  34. Odoo will automatically update the phone number to E.164 format '+33155421242'
  35. and display in the form view of the partner the readable equivalent
  36. '+33 1 55 42 12 42'.
  37. This module also adds *tel:* links on phone numbers and *fax:* links on fax
  38. numbers. If you have a softphone or a client software on your PC that is
  39. associated with *tel:* links, the softphone should propose you to dial the
  40. phone number when you click on such a link.
  41. This module also updates the format() function for reports and adds 2
  42. arguments :
  43. * *phone* : should be True for a phone number, False (default) otherwize.
  44. * *phone_format* : it can have 3 possible values :
  45. * *international* (default) : the report will display '+33 1 55 42 12 42'
  46. * *national* : the report will display '01 55 42 12 42'
  47. * *e164* : the report will display '+33155421242'
  48. For example, in the Sale Order report, to display the phone number of the
  49. Salesman, you can write : o.user_id and o.user_id.phone and
  50. format(o.user_id.phone, phone=True, phone_format='national') or ''
  51. This module is independant from the Asterisk connector.
  52. Please contact Alexis de Lattre from Akretion <alexis.delattre@akretion.com>
  53. for any help or question about this module.
  54. """,
  55. 'author': 'Akretion',
  56. 'website': 'http://www.akretion.com/',
  57. 'depends': ['base', 'web'],
  58. 'external_dependencies': {'python': ['phonenumbers']},
  59. 'data': [
  60. 'security/phone_security.xml',
  61. 'security/ir.model.access.csv',
  62. 'res_partner_view.xml',
  63. 'res_company_view.xml',
  64. 'res_users_view.xml',
  65. 'wizard/reformat_all_phonenumbers_view.xml',
  66. 'wizard/number_not_found_view.xml',
  67. 'web_phone.xml',
  68. ],
  69. 'qweb': ['static/src/xml/*.xml'],
  70. 'demo': ['base_phone_demo.xml'],
  71. 'images': [],
  72. 'installable': True,
  73. }