-
-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
18724b4
commit d4a952a
Showing
28 changed files
with
915 additions
and
678 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
.. image:: https://img.shields.io/badge/licence-LGPL--3-blue.svg | ||
:alt: License LGPL-3 | ||
|
||
====================================== | ||
Connector Phone CloudCTI Event Manager | ||
====================================== | ||
|
||
This module integrates odoo with Phone CloudCTI Event Manager. | ||
|
||
|
||
Credits | ||
======= | ||
|
||
Contributors | ||
------------ | ||
|
||
* Murtuza Saleh <[email protected]> | ||
* Balaji Kannan <[email protected]> | ||
.. image:: https://img.shields.io/badge/licence-LGPL--3-blue.svg | ||
:alt: License LGPL-3 | ||
|
||
====================================== | ||
Connector Phone CloudCTI Event Manager | ||
====================================== | ||
|
||
This module integrates odoo with Phone CloudCTI Event Manager. | ||
|
||
|
||
Credits | ||
======= | ||
|
||
Contributors | ||
------------ | ||
|
||
* Murtuza Saleh <[email protected]> | ||
* Balaji Kannan <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
from . import models | ||
from . import controllers | ||
from . import models | ||
from . import controllers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
from . import main | ||
from . import main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
from . import res_users | ||
from . import phone_common | ||
from . import phone_cdr | ||
from . import res_company | ||
from . import res_partner | ||
from . import sale_order | ||
from . import stock_picking | ||
from . import crm_lead | ||
from . import res_users | ||
from . import phone_common | ||
from . import phone_cdr | ||
from . import res_company | ||
from . import res_partner | ||
from . import sale_order | ||
from . import stock_picking | ||
from . import crm_lead |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 41 additions & 42 deletions
83
connector_phone_cloudcti_event_manager/models/phone_cdr.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,41 @@ | ||
import phonenumbers | ||
|
||
from odoo import _, api, models | ||
|
||
class PhoneCDR(models.Model): | ||
_inherit = "phone.cdr" | ||
|
||
def cloudcti_open_outgoing_notification(self): | ||
called_id = self._context.get('call_no') | ||
caller_id = self.env.user.phone | ||
if caller_id and called_id and caller_id != called_id: | ||
phone = phonenumbers.format_number( | ||
phonenumbers.parse(caller_id, 'US'), | ||
phonenumbers.PhoneNumberFormat.NATIONAL | ||
) | ||
other = phonenumbers.format_number( | ||
phonenumbers.parse(called_id, 'US'), | ||
phonenumbers.PhoneNumberFormat.NATIONAL | ||
) | ||
partner = ( | ||
self.env["phone.common"] | ||
.sudo() | ||
.get_record_from_phone_number(other) | ||
) | ||
# if len(self.partner_ids): | ||
# self.partner_ids[0].cloudcti_outgoing_call_notification() | ||
if self.partner_id: | ||
self.partner_id.cloudcti_outgoing_call_notification() | ||
''' | ||
if partner: | ||
partner[0].sudo().called_for_phone = True | ||
partner[0].sudo().called_for_mobile = False | ||
channel = "notify_info_%s" % self.env.user.id | ||
bus_message = { | ||
"message": _("Calling from : %s" % self.env.user.phone), | ||
"title": _("Outgoing Call to %s" % called_id), | ||
"action_link_name": "action_link_name", | ||
"Outnotification": "OutGoingNotification", | ||
"id": self.id, | ||
} | ||
self.env["bus.bus"].sendone(channel, bus_message) | ||
''' | ||
import phonenumbers | ||
|
||
from odoo import models | ||
|
||
|
||
class PhoneCDR(models.Model): | ||
_inherit = "phone.cdr" | ||
|
||
def cloudcti_open_outgoing_notification(self): | ||
called_id = self._context.get("call_no") | ||
caller_id = self.env.user.phone | ||
if caller_id and called_id and caller_id != called_id: | ||
phone = phonenumbers.format_number( | ||
phonenumbers.parse(caller_id, "US"), | ||
phonenumbers.PhoneNumberFormat.NATIONAL, | ||
) | ||
other = phonenumbers.format_number( | ||
phonenumbers.parse(called_id, "US"), | ||
phonenumbers.PhoneNumberFormat.NATIONAL, | ||
) | ||
partner = ( | ||
self.env["phone.common"].sudo().get_record_from_phone_number(other) | ||
) | ||
# if len(self.partner_ids): | ||
# self.partner_ids[0].cloudcti_outgoing_call_notification() | ||
if self.partner_id: | ||
self.partner_id.cloudcti_outgoing_call_notification() | ||
""" | ||
if partner: | ||
partner[0].sudo().called_for_phone = True | ||
partner[0].sudo().called_for_mobile = False | ||
channel = "notify_info_%s" % self.env.user.id | ||
bus_message = { | ||
"message": _("Calling from : %s" % self.env.user.phone), | ||
"title": _("Outgoing Call to %s" % called_id), | ||
"action_link_name": "action_link_name", | ||
"Outnotification": "OutGoingNotification", | ||
"id": self.id, | ||
} | ||
self.env["bus.bus"].sendone(channel, bus_message) | ||
""" |
Oops, something went wrong.