res_partner.py 614 B

123456789101112131415161718192021
  1. # -*- coding: utf-8 -*-
  2. # Part of Odoo. See LICENSE file for full copyright and licensing details.
  3. from odoo import models
  4. class ResPartner(models.Model):
  5. _name = 'res.partner'
  6. _inherit = ['mail.thread.phone', 'res.partner']
  7. def _sms_get_default_partners(self):
  8. """ Override of mail.thread method.
  9. SMS recipients on partners are the partners themselves.
  10. """
  11. return self
  12. def _phone_get_number_fields(self):
  13. """ This method returns the fields to use to find the number to use to
  14. send an SMS on a record. """
  15. return ['mobile', 'phone']