<commit_before># -*- coding: utf-8 -*-
# © 2012-2016 Akretion (<NAME> <<EMAIL>>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from openerp import models, api


class EventRegistration(models.Model):
    _name = 'event.registration'
    _inherit = ['event.registration', 'phone.common']
    _phone_fields = ['phone']
    _phone_name_sequence = 100
    _country_field = None
    _partner_field = 'partner_id'

    @api.model
    def create(self, vals):
        vals_reformated = self._reformat_phonenumbers_create(vals)
        return super(EventRegistration, self).create(vals_reformated)

    @api.multi
    def write(self, vals):
        vals_reformated = self._reformat_phonenumbers_write(vals)
        return super(EventRegistration, self).write(vals_reformated)<commit_msg>Started to implement solution d) as discussed in https://github.com/OCA/connector-telephony/issues/90<commit_after># -*- coding: utf-8 -*-
# © 2012-2016 Akretion (<NAME> <<EMAIL>>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from openerp import models
from openerp.addons.base_phone.fields import Phone


class EventRegistration(models.Model):
    _inherit = 'event.registration'
    _phone_name_sequence = 100

    phone = Phone(partner_field='partner_id')
{'fraction_non_alphanumeric': 0.12627450980392158, 'fraction_numerical': 0.023529411764705882, 'mean_word_length': 4.063492063492063, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 1, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7526793', 'n_tokens_mistral': 445, 'n_tokens_neox': 405, 'n_words': 87}