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.

29 lines
1.2 KiB

  1. # -*- coding: utf-8 -*-
  2. # Copyright 2016-2018 Akretion France
  3. # @author: Alexis de Lattre <alexis.delattre@akretion.com>
  4. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  5. from odoo import models, 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. _sql_constraints = [(
  21. 'number_of_digits_to_match_from_end_positive',
  22. 'CHECK (number_of_digits_to_match_from_end > 0)',
  23. "The value of the field 'Number of Digits To Match From End' must "
  24. "be positive.")]