From 09b4feaceec59aa1bbed14267a80a81f1a7f7088 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 28 Jul 2014 00:49:09 +0200 Subject: [PATCH] Very large changes in the structure of the project : - move more asterisk-independant code to base_phone module and create new asterisk-independant modules - rename module asterisk_popup to base_phone_popup - add ability to get callerid names not only from partners, but also from leads, employees, applicants, etc... - same for auto pop-up : not only for partners, but also for leads, employees, etc... --- asterisk_click2dial/__openerp__.py | 3 +- asterisk_click2dial/asterisk_click2dial.py | 86 +++------- asterisk_click2dial/asterisk_server_view.xml | 29 +--- asterisk_click2dial/res_partner_view.xml | 7 +- asterisk_click2dial/res_users_view.xml | 51 +++--- asterisk_click2dial/scripts/get_cid_name.py | 26 +-- .../security/ir.model.access.csv | 2 - .../wizard/open_calling_partner.py | 31 ++-- asterisk_click2dial_crm/__openerp__.py | 5 +- .../asterisk_click2dial_crm.py | 17 -- asterisk_click2dial_crm/crm_lead_view.xml | 6 - asterisk_click2dial_crm/res_users_view.xml | 23 +-- asterisk_click2dial_crm/wizard/__init__.py | 1 - .../wizard/create_crm_phonecall_view.xml | 1 - .../wizard/reformat_all_phonenumbers.py | 39 ----- asterisk_click2dial_crm_claim/__init__.py | 1 - asterisk_click2dial_crm_claim/__openerp__.py | 4 +- .../crm_claim_view.xml | 4 +- .../wizard/__init__.py | 1 - .../wizard/open_calling_partner.py | 2 +- .../wizard/reformat_all_phonenumbers.py | 39 ----- .../__init__.py | 1 - .../__openerp__.py | 4 +- .../asterisk_click2dial_registration.py | 0 .../registration_view.xml | 20 +-- .../wizard/__init__.py | 0 .../wizard/open_calling_partner.py | 2 +- .../wizard/open_calling_partner_view.xml | 0 asterisk_popup/res_users_view.xml | 36 ----- base_phone/__init__.py | 2 +- base_phone/__openerp__.py | 6 +- base_phone/base_phone.py | 153 +++++++++++++++++- base_phone/res_company_view.xml | 27 ++++ base_phone/res_users_view.xml | 40 +++++ base_phone/security/ir.model.access.csv | 2 + .../security/phone_security.xml | 8 +- .../wizard/reformat_all_phonenumbers.py | 63 ++++---- .../wizard/reformat_all_phonenumbers_view.xml | 13 +- .../__init__.py | 2 +- .../__openerp__.py | 17 +- .../i18n/asterisk_popup.pot | 0 .../i18n/fr.po | 0 {asterisk_popup => base_phone_popup}/popup.py | 39 +++-- base_phone_popup/res_users_view.xml | 39 +++++ crm_claim_phone/__init__.py | 22 +++ crm_claim_phone/__openerp__.py | 46 ++++++ .../crm_claim_phone.py | 39 ++--- crm_claim_phone/crm_claim_view.xml | 23 +++ crm_phone/__init__.py | 22 +++ crm_phone/__openerp__.py | 49 ++++++ crm_phone/crm_phone.py | 98 +++++++++++ crm_phone/crm_view.xml | 59 +++++++ crm_phone/security/ir.model.access.csv | 2 + event_phone/__init__.py | 22 +++ event_phone/__openerp__.py | 49 ++++++ event_phone/event_phone.py | 53 ++++++ event_phone/event_view.xml | 34 ++++ event_phone/security/ir.model.access.csv | 2 + hr_phone/__init__.py | 22 +++ hr_phone/__openerp__.py | 49 ++++++ hr_phone/hr_phone.py | 53 ++++++ hr_phone/hr_view.xml | 25 +++ hr_phone/security/ir.model.access.csv | 2 + hr_recruitment_phone/__init__.py | 22 +++ hr_recruitment_phone/__openerp__.py | 49 ++++++ hr_recruitment_phone/hr_recruitment_phone.py | 53 ++++++ hr_recruitment_phone/hr_recruitment_view.xml | 25 +++ .../security/ir.model.access.csv | 2 + 68 files changed, 1238 insertions(+), 436 deletions(-) delete mode 100644 asterisk_click2dial_crm/wizard/reformat_all_phonenumbers.py delete mode 100644 asterisk_click2dial_crm_claim/wizard/reformat_all_phonenumbers.py rename {asterisk_click2dial_registration => asterisk_click2dial_event}/__init__.py (95%) rename {asterisk_click2dial_registration => asterisk_click2dial_event}/__openerp__.py (97%) rename {asterisk_click2dial_registration => asterisk_click2dial_event}/asterisk_click2dial_registration.py (100%) rename {asterisk_click2dial_registration => asterisk_click2dial_event}/registration_view.xml (67%) rename {asterisk_click2dial_registration => asterisk_click2dial_event}/wizard/__init__.py (100%) rename {asterisk_click2dial_registration => asterisk_click2dial_event}/wizard/open_calling_partner.py (94%) rename {asterisk_click2dial_registration => asterisk_click2dial_event}/wizard/open_calling_partner_view.xml (100%) delete mode 100644 asterisk_popup/res_users_view.xml create mode 100644 base_phone/res_company_view.xml create mode 100644 base_phone/res_users_view.xml create mode 100644 base_phone/security/ir.model.access.csv rename asterisk_click2dial/security/asterisk_server_security.xml => base_phone/security/phone_security.xml (52%) rename {asterisk_popup => base_phone_popup}/__init__.py (95%) rename {asterisk_popup => base_phone_popup}/__openerp__.py (80%) rename {asterisk_popup => base_phone_popup}/i18n/asterisk_popup.pot (100%) rename {asterisk_popup => base_phone_popup}/i18n/fr.po (100%) rename {asterisk_popup => base_phone_popup}/popup.py (75%) create mode 100644 base_phone_popup/res_users_view.xml create mode 100644 crm_claim_phone/__init__.py create mode 100644 crm_claim_phone/__openerp__.py rename asterisk_click2dial_crm_claim/asterisk_click2dial_crm_claim.py => crm_claim_phone/crm_claim_phone.py (61%) create mode 100644 crm_claim_phone/crm_claim_view.xml create mode 100644 crm_phone/__init__.py create mode 100644 crm_phone/__openerp__.py create mode 100644 crm_phone/crm_phone.py create mode 100644 crm_phone/crm_view.xml create mode 100644 crm_phone/security/ir.model.access.csv create mode 100644 event_phone/__init__.py create mode 100644 event_phone/__openerp__.py create mode 100644 event_phone/event_phone.py create mode 100644 event_phone/event_view.xml create mode 100644 event_phone/security/ir.model.access.csv create mode 100644 hr_phone/__init__.py create mode 100644 hr_phone/__openerp__.py create mode 100644 hr_phone/hr_phone.py create mode 100644 hr_phone/hr_view.xml create mode 100644 hr_phone/security/ir.model.access.csv create mode 100644 hr_recruitment_phone/__init__.py create mode 100644 hr_recruitment_phone/__openerp__.py create mode 100644 hr_recruitment_phone/hr_recruitment_phone.py create mode 100644 hr_recruitment_phone/hr_recruitment_view.xml create mode 100644 hr_recruitment_phone/security/ir.model.access.csv diff --git a/asterisk_click2dial/__openerp__.py b/asterisk_click2dial/__openerp__.py index bac6600..8836b03 100644 --- a/asterisk_click2dial/__openerp__.py +++ b/asterisk_click2dial/__openerp__.py @@ -23,7 +23,7 @@ { 'name': 'Asterisk Click2dial', 'version': '0.4', - 'category': 'Extra Tools', + 'category': 'Phone', 'license': 'AGPL-3', 'summary': 'Asterisk-OpenERP connector', 'description': """This module adds 3 functionalities : @@ -58,7 +58,6 @@ A detailed documentation for this module is available on the Akretion Web site : 'res_users_view.xml', 'res_partner_view.xml', 'wizard/open_calling_partner_view.xml', - 'security/asterisk_server_security.xml', 'security/ir.model.access.csv', ], 'demo': ['asterisk_click2dial_demo.xml'], diff --git a/asterisk_click2dial/asterisk_click2dial.py b/asterisk_click2dial/asterisk_click2dial.py index 9d4731a..9795ae0 100644 --- a/asterisk_click2dial/asterisk_click2dial.py +++ b/asterisk_click2dial/asterisk_click2dial.py @@ -50,7 +50,6 @@ class asterisk_server(orm.Model): 'wait_time': fields.integer('Wait time (sec)', required=True, help="Amount of time (in seconds) Asterisk will try to reach the user's phone before hanging up."), 'extension_priority': fields.integer('Extension priority', required=True, help="Priority of the extension in the Asterisk dialplan. Refer to /etc/asterisk/extensions.conf on your Asterisk server."), 'alert_info': fields.char('Alert-Info SIP header', size=255, help="Set Alert-Info header in SIP request to user's IP Phone for the click2dial feature. If empty, the Alert-Info header will not be added. You can use it to have a special ring tone for click2dial (a silent one !) or to activate auto-answer for example."), - 'number_of_digits_to_match_from_end': fields.integer('Number of digits to match from end', help='In several situations, the Asterisk-OpenERP connector will have to find a Partner in OpenERP from a phone number presented by the calling party. As the phone numbers presented by your phone operator may not always be displayed in a standard format, the best method to find the related Partner in OpenERP is to try to match the end of the phone numbers of the Partners in OpenERP with the N last digits of the phone number presented by the calling party. N is the value you should enter in this field.'), 'company_id': fields.many2one('res.company', 'Company', help="Company who uses the Asterisk server."), } @@ -65,13 +64,11 @@ class asterisk_server(orm.Model): _defaults = { 'active': True, 'port': 5038, # Default AMI port - 'out_prefix': '0', 'national_prefix': '0', 'international_prefix': '00', 'country_prefix': _get_prefix_from_country, 'extension_priority': 1, 'wait_time': 15, - 'number_of_digits_to_match_from_end': 9, 'company_id': lambda self, cr, uid, context: self.pool.get('res.company')._company_default_get(cr, uid, 'asterisk.server', context=context), } @@ -95,8 +92,6 @@ class asterisk_server(orm.Model): raise orm.except_orm(_('Error :'), _("The 'extension priority' must be a positive value for the Asterisk server '%s'" % server.name)) if server.port > 65535 or server.port < 1: raise orm.except_orm(_('Error :'), _("You should set a TCP port between 1 and 65535 for the Asterisk server '%s'" % server.name)) - if server.number_of_digits_to_match_from_end > 20 or server.number_of_digits_to_match_from_end < 1: - raise orm.except_orm(_('Error :'), _("You should set a 'Number of digits to match from end' between 1 and 20 for the Asterisk server '%s'" % server.name)) for check_string in [dialplan_context, alert_info, login, password]: if check_string[1]: try: @@ -107,7 +102,7 @@ class asterisk_server(orm.Model): _constraints = [ - (_check_validity, "Error message in raise", ['out_prefix', 'country_prefix', 'national_prefix', 'international_prefix', 'wait_time', 'extension_priority', 'port', 'context', 'alert_info', 'login', 'password', 'number_of_digits_to_match_from_end']), + (_check_validity, "Error message in raise", ['out_prefix', 'country_prefix', 'national_prefix', 'international_prefix', 'wait_time', 'extension_priority', 'port', 'context', 'alert_info', 'login', 'password']), ] @@ -395,65 +390,20 @@ class phone_common(orm.AbstractModel): raise orm.except_orm(_('Error :'), _('There is no phone number !')) return self.pool['asterisk.server']._dial_with_asterisk(cr, uid, erp_number_e164, context=context) - -class res_partner(orm.Model): - _name = 'res.partner' - _inherit = ['res.partner', 'phone.common'] - - def get_name_from_phone_number(self, cr, uid, number, context=None): - '''Function to get name from phone number. Usefull for use from Asterisk - to add CallerID name to incoming calls. - The "scripts/" subdirectory of this module has an AGI script that you can - install on your Asterisk IPBX : the script will be called from the Asterisk - dialplan via the AGI() function and it will use this function via an XML-RPC - request. - ''' - res = self.get_partner_from_phone_number(cr, uid, number, context=context) - if res: - return res[2] - else: - return False - - - def get_partner_from_phone_number(self, cr, uid, presented_number, context=None): - # We check that "number" is really a number - _logger.debug(u"Call get_name_from_phone_number with number = %s" % presented_number) - if not isinstance(presented_number, (str, unicode)): - _logger.warning(u"Number '%s' should be a 'str' or 'unicode' but it is a '%s'" % (presented_number, type(presented_number))) - return False - if not presented_number.isdigit(): - _logger.warning(u"Number '%s' should only contain digits." % presented_number) - return False - - ast_server = self.pool['asterisk.server']._get_asterisk_server_from_user(cr, uid, context=context) - nr_digits_to_match_from_end = ast_server.number_of_digits_to_match_from_end - if len(presented_number) >= nr_digits_to_match_from_end: - end_number_to_match = presented_number[-nr_digits_to_match_from_end:len(presented_number)] - else: - end_number_to_match = presented_number - - _logger.debug("Will search phone and mobile numbers in res.partner ending with '%s'" % end_number_to_match) - - # We try to match a phone or mobile number with the same end - pg_seach_number = str('%' + end_number_to_match) - res_ids = self.search(cr, uid, ['|', ('phone', 'like', pg_seach_number), ('mobile', 'like', pg_seach_number)], context=context) - # TODO : use is_number_match() of the phonenumber lib ? - if len(res_ids) > 1: - _logger.warning(u"There are several partners (IDS = %s) with a phone number ending with '%s'" % (str(res_ids), end_number_to_match)) - if res_ids: - entry = self.read(cr, uid, res_ids[0], ['name', 'parent_id'], context=context) - _logger.debug(u"Answer get_partner_from_phone_number with name = %s" % entry['name']) - return (entry['id'], entry['parent_id'] and entry['parent_id'][0] or False, entry['name']) - else: - _logger.debug(u"No match for end of phone number '%s'" % end_number_to_match) - return False - - -# This module supports multi-company -class res_company(orm.Model): - _inherit = "res.company" - - _columns = { - 'asterisk_server_ids': fields.one2many('asterisk.server', 'company_id', 'Asterisk servers', help="List of Asterisk servers.") - } - + def _prepare_incall_pop_action( + self, cr, uid, record_res, number, context=None): + # Not executed because this module doesn't depend on base_phone_popup + # TODO move to a dedicated module asterisk_popup ? + action = super(phone_common, self)._prepare_incall_pop_action( + cr, uid, record_res, number, context=context) + if not action: + action = { + 'name': _('No Partner Found'), + 'type': 'ir.actions.act_window', + 'res_model': 'wizard.open.calling.partner', + 'view_mode': 'form', + 'views': [[False, 'form']], # Beurk, but needed + 'target': 'new', + 'context': {'incall_number_popup': number} + } + return action diff --git a/asterisk_click2dial/asterisk_server_view.xml b/asterisk_click2dial/asterisk_server_view.xml index 0bcc1af..3bf813f 100644 --- a/asterisk_click2dial/asterisk_server_view.xml +++ b/asterisk_click2dial/asterisk_server_view.xml @@ -8,28 +8,14 @@ - - - asterisk.server.company - res.company - - - - - - - - - - asterisk.server.search asterisk.server - - + @@ -48,7 +34,9 @@ - + @@ -62,7 +50,6 @@ - @@ -75,10 +62,11 @@ asterisk.server - - + @@ -88,7 +76,6 @@ Asterisk Servers asterisk.server - form tree,form {'asterisk_server_main_view': True} diff --git a/asterisk_click2dial/res_partner_view.xml b/asterisk_click2dial/res_partner_view.xml index 142ab07..4264da0 100644 --- a/asterisk_click2dial/res_partner_view.xml +++ b/asterisk_click2dial/res_partner_view.xml @@ -1,7 +1,7 @@ + + 0 + + + + + + + + + + + + + + - diff --git a/asterisk_click2dial/scripts/get_cid_name.py b/asterisk_click2dial/scripts/get_cid_name.py index b3616cb..44680df 100755 --- a/asterisk_click2dial/scripts/get_cid_name.py +++ b/asterisk_click2dial/scripts/get_cid_name.py @@ -3,13 +3,15 @@ """ CallerID name lookup in OpenERP for Asterisk IPBX - When executed from the dialplan on an incoming phone call, it will lookup in - OpenERP's partners, and, if it finds the phone number, it will get the - corresponding name of the person and use this name as CallerID name for the incoming call. + When executed from the dialplan on an incoming phone call, it will + lookup in OpenERP's partners and other objects with phone numbers + (leads, employees, etc...), and, if it finds the phone number, it will + get the corresponding name of the person and use this name as CallerID + name for the incoming call. - Requires the "asterisk_click2dial" module + Requires the "base_phone" module available from https://code.launchpad.net/openerp-asterisk-connector - for OpenERP version >= 5.0 + for OpenERP version >= 7.0 This script is designed to be used as an AGI on an Asterisk IPBX... BUT I advise you to use a wrapper around this script to control the @@ -19,7 +21,7 @@ The simplest solution I found is to use the "timeout" shell command to call this script, for example : - # timeout 1s get_cid_name.py + # timeout 2s get_cid_name.py See my sample wrapper "get_cid_name_timeout.sh" @@ -41,10 +43,10 @@ """ __author__ = "Alexis de Lattre " -__date__ = "December 2010" -__version__ = "0.3" +__date__ = "July 2014" +__version__ = "0.4" -# Copyright (C) 2010-2012 Alexis de Lattre +# Copyright (C) 2010-2014 Alexis de Lattre # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -64,7 +66,7 @@ import sys from optparse import OptionParser -# CID Name that will be displayed if there is no match in res.partner +# CID Name that will be displayed if there is no match # and no geolocalisation default_cid_name = "Not in OpenERP" @@ -198,13 +200,13 @@ def main(options, arguments): if options.notify and arguments: res = sock.execute( options.database, options.user, options.password, - 'res.partner', 'incall_notify_by_login', + 'phone.common', 'incall_notify_by_login', input_cid_number, arguments) stdout_write('VERBOSE "Calling incall_notify_by_login"\n') else: res = sock.execute( options.database, options.user, options.password, - 'res.partner', 'get_name_from_phone_number', + 'phone.common', 'get_name_from_phone_number', input_cid_number) stdout_write('VERBOSE "Calling get_name_from_phone_number"\n') stdout_write('VERBOSE "End of XML-RPC request on OpenERP"\n') diff --git a/asterisk_click2dial/security/ir.model.access.csv b/asterisk_click2dial/security/ir.model.access.csv index 011c2e0..eabc9d1 100644 --- a/asterisk_click2dial/security/ir.model.access.csv +++ b/asterisk_click2dial/security/ir.model.access.csv @@ -1,5 +1,3 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink ir_model_access_asterisk_server_user,Read access on asterisk.server,model_asterisk_server,base.group_user,1,0,0,0 ir_model_access_asterisk_server_system,Full rights on asterisk.server,model_asterisk_server,base.group_system,1,1,1,1 -asterisk_cid_res_partner_read,Read access on res.partner,base.model_res_partner,group_asterisk_cid,1,0,0,0 -asterisk_cid_asterisk_server_read,Read access on asterisk.server,model_asterisk_server,group_asterisk_cid,1,0,0,0 diff --git a/asterisk_click2dial/wizard/open_calling_partner.py b/asterisk_click2dial/wizard/open_calling_partner.py index 0b9ec97..0dcc742 100644 --- a/asterisk_click2dial/wizard/open_calling_partner.py +++ b/asterisk_click2dial/wizard/open_calling_partner.py @@ -57,22 +57,29 @@ class wizard_open_calling_partner(orm.TransientModel): res['to_update_partner_id'] = False res['calling_number'] = context.get('incall_number_popup') else: - calling_number = self.pool['asterisk.server']._get_calling_number(cr, uid, context=context) + calling_number = self.pool['asterisk.server']._get_calling_number( + cr, uid, context=context) #To test the code without Asterisk server #calling_number = "0141981246" if calling_number: res['calling_number'] = calling_number - partner = self.pool['res.partner'].get_partner_from_phone_number(cr, uid, calling_number, context=context) - if partner: - res['partner_id'] = partner[0] - res['parent_partner_id'] = partner[1] + record = self.pool['phone.common'].get_record_from_phone_number( + cr, uid, calling_number, context=context) + if record and record[0] == 'res.partner': + res['partner_id'] = record[1] + partner = self.pool['res.partner'].browse( + cr, uid, record[1], context=context) + res['parent_partner_id'] = \ + partner.parent_id and partner.parent_id.id or False else: res['partner_id'] = False res['parent_partner_id'] = False res['to_update_partner_id'] = False else: _logger.debug("Could not get the calling number from Asterisk.") - raise orm.except_orm(_('Error :'), _("Could not get the calling number from Asterisk. Is your phone ringing or are you currently on the phone ? If yes, check your setup and look at the OpenERP debug logs.")) + raise orm.except_orm( + _('Error :'), + _("Could not get the calling number from Asterisk. Is your phone ringing or are you currently on the phone ? If yes, check your setup and look at the OpenERP debug logs.")) return res @@ -98,8 +105,7 @@ class wizard_open_calling_partner(orm.TransientModel): if partner_id_to_filter: action = { 'name': oerp_object._description, - 'view_type': 'form', - 'view_mode': 'tree,form', + 'view_mode': 'tree,form,kanban', 'res_model': oerp_object._name, 'type': 'ir.actions.act_window', 'nodestroy': False, # close the pop-up wizard after action @@ -126,8 +132,7 @@ class wizard_open_calling_partner(orm.TransientModel): if record_to_open: return { 'name': self.pool['res.partner']._description, - 'view_type': 'form', - 'view_mode': 'form,tree', + 'view_mode': 'form,tree,kanban', 'res_model': 'res.partner', 'type': 'ir.actions.act_window', 'nodestroy': False, # close the pop-up wizard after action @@ -160,8 +165,7 @@ class wizard_open_calling_partner(orm.TransientModel): action = { 'name': 'Create new partner', - 'view_type': 'form', - 'view_mode': 'form,tree', + 'view_mode': 'form,tree,kanban', 'res_model': 'res.partner', 'type': 'ir.actions.act_window', 'nodestroy': False, @@ -188,8 +192,7 @@ class wizard_open_calling_partner(orm.TransientModel): self.pool['res.partner'].write(cr, uid, cur_wizard.to_update_partner_id.id, {phone_type: number_to_write}, context=context) action = { 'name': 'Partner: ' + cur_wizard.to_update_partner_id.name, - 'view_type': 'form', - 'view_mode': 'form,tree', + 'view_mode': 'form,tree,kanban', 'res_model': 'res.partner', 'type': 'ir.actions.act_window', 'nodestroy': False, diff --git a/asterisk_click2dial_crm/__openerp__.py b/asterisk_click2dial_crm/__openerp__.py index 87a3e90..f8ea05d 100644 --- a/asterisk_click2dial_crm/__openerp__.py +++ b/asterisk_click2dial_crm/__openerp__.py @@ -28,7 +28,7 @@ "author": "Zikzakmedia SL, Akretion", "website": "http://www.zikzakmedia.com", "license": "AGPL-3", - "category": "Customer Relationship Management", + "category": "Phone", "description": """ Asterisk Click2dial CRM ======================= @@ -47,7 +47,7 @@ A detailed documentation for the OpenERP-Asterisk connector is available on the """, "depends": [ 'asterisk_click2dial', - 'crm', + 'crm_phone', ], "demo": [], "data": [ @@ -55,7 +55,6 @@ A detailed documentation for the OpenERP-Asterisk connector is available on the 'wizard/create_crm_phonecall_view.xml', 'res_users_view.xml', 'crm_lead_view.xml', - 'crm_phonecall_view.xml', ], "installable": True, "application": True, diff --git a/asterisk_click2dial_crm/asterisk_click2dial_crm.py b/asterisk_click2dial_crm/asterisk_click2dial_crm.py index e531956..bf1ff05 100644 --- a/asterisk_click2dial_crm/asterisk_click2dial_crm.py +++ b/asterisk_click2dial_crm/asterisk_click2dial_crm.py @@ -71,20 +71,3 @@ class res_users(orm.Model): _defaults = { 'context_propose_creation_crm_call': True, } - - -class crm_lead(orm.Model): - _name = 'crm.lead' - _inherit = ['crm.lead', 'phone.common'] - - def create(self, cr, uid, vals, context=None): - vals_reformated = self._generic_reformat_phonenumbers( - cr, uid, vals, context=context) - return super(crm_lead, self).create( - cr, uid, vals_reformated, context=context) - - def write(self, cr, uid, ids, vals, context=None): - vals_reformated = self._generic_reformat_phonenumbers( - cr, uid, vals, context=context) - return super(crm_lead, self).write( - cr, uid, ids, vals_reformated, context=context) diff --git a/asterisk_click2dial_crm/crm_lead_view.xml b/asterisk_click2dial_crm/crm_lead_view.xml index 6fb50df..799b112 100644 --- a/asterisk_click2dial_crm/crm_lead_view.xml +++ b/asterisk_click2dial_crm/crm_lead_view.xml @@ -29,9 +29,6 @@