addons14/base_phone/models/phone_common.py
def convert_to_dial_number(self, erp_number):
        """
        This function is dedicated to the transformation of the number
        available in Odoo to the number that can be dialed.
        You may have to inherit this function in another module specific
        for your company if you are not happy with the way I reformat
        the numbers.
        """
        assert erp_number, "Missing phone number"
        _logger.debug("Number before reformat = %s" % erp_number)
        # erp_number are supposed to be in International format, so no need to
        # give a country code here
        parsed_num = phonenumbers.parse(erp_number, None)
        country_code = self.env.user.company_id.country_id.code
        assert country_code, "Missing country on company"
        _logger.debug("Country code = %s" % country_code)
        to_dial_number = phonenumbers.format_out_of_country_calling_number(
            parsed_num, country_code.upper()
        )
        to_dial_number = to_dial_number.translate(
            to_dial_number.maketrans("", "", " -.()/")
        )
        _logger.debug("Number to be sent to phone system: %s" % to_dial_number)
        return to_dial_number

        This function is dedicated to the transformation of the number
        available in Odoo to the number that can be dialed.
        You may have to inherit this function in another module specific
        for your company if you are not happy with the way I reformat
        the numbers.
        
This function is dedicated to the transformation of the number
available in Odoo to the number that can be dialed.
You may have to inherit this function in another module specific
for your company if you are not happy with the way I reformat
the numbers.
This function is dedicated to the transformation of the number available in Odoo to the number that can be dialed . You may have to inherit this function in another module specific for your company if you are not happy with the way I reformat the numbers .
def convert_to_dial_number(self, erp_number):
        assert erp_number, "Missing phone number"
        _logger.debug("Number before reformat = %s" % erp_number)
        parsed_num = phonenumbers.parse(erp_number, None)
        country_code = self.env.user.company_id.country_id.code
        assert country_code, "Missing country on company"
        _logger.debug("Country code = %s" % country_code)
        to_dial_number = phonenumbers.format_out_of_country_calling_number(
            parsed_num, country_code.upper()
        )
        to_dial_number = to_dial_number.translate(
            to_dial_number.maketrans("", "", " -.()/")
        )
        _logger.debug("Number to be sent to phone system: %s" % to_dial_number)
        return to_dial_number
def convert_to_dial_number ( self , erp_number ) : assert erp_number , "Missing phone number" _logger . debug ( "Number before reformat = %s" % erp_number ) parsed_num = phonenumbers . parse ( erp_number , None ) country_code = self . env . user . company_id . country_id . code assert country_code , "Missing country on company" _logger . debug ( "Country code = %s" % country_code ) to_dial_number = phonenumbers . format_out_of_country_calling_number ( parsed_num , country_code . upper ( ) ) to_dial_number = to_dial_number . translate ( to_dial_number . maketrans ( "" , "" , " -.()/" ) ) _logger . debug ( "Number to be sent to phone system: %s" % to_dial_number ) return to_dial_number
This function is dedicated to the transformation of the number
available in Odoo to the number that can be dialed.
This function is dedicated to the transformation of the number available in Odoo to the number that can be dialed .
"""
        This function is dedicated to the transformation of the number
        available in Odoo to the number that can be dialed.
        You may have to inherit this function in another module specific
        for your company if you are not happy with the way I reformat
        the numbers.
        """ # erp_number are supposed to be in International format, so no need to # give a country code here
self
erp_number