From be2d36c81721bba4064099fa4fcc6aad7dec8d1f Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Thu, 4 Oct 2012 10:13:22 +0200 Subject: [PATCH] More debug and warning messages, to help a user in its debug. --- asterisk_click2dial/asterisk_click2dial.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/asterisk_click2dial/asterisk_click2dial.py b/asterisk_click2dial/asterisk_click2dial.py index 2852e13..f162d52 100644 --- a/asterisk_click2dial/asterisk_click2dial.py +++ b/asterisk_click2dial/asterisk_click2dial.py @@ -514,12 +514,14 @@ class res_partner_address(osv.osv): def get_partner_from_phone_number(self, cr, uid, number, context=None): # We check that "number" is really a number + _logger.debug(u"Call get_name_from_phone_number with number = %s" % number) if not isinstance(number, str): + _logger.warning(u"Number should be a 'str' but it is a '%s'" % type(number)) return False + _logger.warning(u"Number should only contain digits.") if not number.isdigit(): return False - _logger.debug(u"Call get_name_from_phone_number with number = %s" % number) # We try to match a phone or mobile number with the same end pg_seach_number = '%' + number res_ids = self.search(cr, uid, ['|', ('phone_e164', 'ilike', pg_seach_number), ('mobile_e164', 'ilike', pg_seach_number)], context=context)