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.

23 lines
776 B

  1. # -*- coding: utf-8 -*-
  2. # Copyright 2012-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 api, models, _
  6. class PhoneCommon(models.AbstractModel):
  7. _inherit = 'phone.common'
  8. @api.model
  9. def click2dial(self, erp_number):
  10. res = super(PhoneCommon, self).click2dial(erp_number)
  11. if (
  12. self.env.user.context_propose_creation_crm_call and
  13. self.env.context.get('click2dial_model')
  14. in ('res.partner', 'crm.lead')):
  15. res.update({
  16. 'action_name': _('Create Call in CRM'),
  17. 'action_model': 'wizard.create.crm.phonecall',
  18. })
  19. return res