mirror of
https://gitlab.com/flectra-community/partner-contact.git
synced 2024-12-24 05:11:47 +00:00
18 lines
529 B
Python
18 lines
529 B
Python
# Copyright 2020 - Iván Todorovich
|
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
|
|
|
from flectra import api, fields, models
|
|
|
|
|
|
class ResPartner(models.Model):
|
|
_inherit = "res.partner"
|
|
|
|
phone2 = fields.Char("Phone (Secondary)")
|
|
|
|
@api.onchange("phone2", "country_id", "company_id")
|
|
def _onchange_phone2_validation(self):
|
|
# Compatibility with phone_validation
|
|
if hasattr(self, "phone_format"):
|
|
if self.phone2:
|
|
self.phone2 = self.phone_format(self.phone2)
|