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.

22 lines
753 B

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