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.

33 lines
1.4 KiB

  1. # -*- coding: utf-8 -*-
  2. # © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  4. from odoo import models, fields
  5. from .. import fields as phone_fields
  6. class ResCompany(models.Model):
  7. _inherit = 'res.company'
  8. number_of_digits_to_match_from_end = fields.Integer(
  9. string='Number of Digits To Match From End',
  10. default=8,
  11. help="In several situations, Odoo will have to find a "
  12. "Partner/Lead/Employee/... from a phone number presented by the "
  13. "calling party. As the phone numbers presented by your phone "
  14. "operator may not always be displayed in a standard format, "
  15. "the best method to find the related Partner/Lead/Employee/... "
  16. "in Odoo is to try to match the end of the phone number in "
  17. "Odoo with the N last digits of the phone number presented "
  18. "by the calling party. N is the value you should enter in this "
  19. "field.")
  20. phone = phone_fields.Phone(
  21. country_field='country_id', partner_field='partner_id')
  22. fax = phone_fields.Fax(
  23. country_field='country_id', partner_field='partner_id')
  24. _sql_constraints = [(
  25. 'number_of_digits_to_match_from_end_positive',
  26. 'CHECK (number_of_digits_to_match_from_end > 0)',
  27. "The value of the field 'Number of Digits To Match From End' must "
  28. "be positive.")]