You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
526 B

  1. # Copyright 2020 - Iván Todorovich
  2. # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
  3. from odoo import api, fields, models
  4. class ResPartner(models.Model):
  5. _inherit = "res.partner"
  6. phone2 = fields.Char("Phone (Secondary)")
  7. @api.onchange("phone2", "country_id", "company_id")
  8. def _onchange_phone2_validation(self):
  9. # Compatibility with phone_validation
  10. if hasattr(self, "phone_format"):
  11. if self.phone2:
  12. self.phone2 = self.phone_format(self.phone2)