2018-01-16 06:58:15 +01:00
|
|
|
# -*- coding: utf-8 -*-
|
2018-01-16 11:34:37 +01:00
|
|
|
# Part of Odoo, Flectra. See LICENSE file for full copyright and licensing details.
|
2018-01-16 06:58:15 +01:00
|
|
|
|
2018-01-16 11:34:37 +01:00
|
|
|
from flectra import api, models
|
2018-01-16 06:58:15 +01:00
|
|
|
|
|
|
|
|
|
|
|
class Lead(models.Model):
|
|
|
|
_name = 'crm.lead'
|
|
|
|
_inherit = ['crm.lead', 'phone.validation.mixin']
|
|
|
|
|
2018-04-05 10:25:40 +02:00
|
|
|
@api.onchange('phone', 'country_id', 'company_id')
|
2018-01-16 06:58:15 +01:00
|
|
|
def _onchange_phone_validation(self):
|
|
|
|
if self.phone:
|
|
|
|
self.phone = self.phone_format(self.phone)
|
|
|
|
|
2018-04-05 10:25:40 +02:00
|
|
|
@api.onchange('mobile', 'country_id', 'company_id')
|
2018-01-16 06:58:15 +01:00
|
|
|
def _onchange_mobile_validation(self):
|
|
|
|
if self.mobile:
|
|
|
|
self.mobile = self.phone_format(self.mobile)
|
|
|
|
|