Maxime Chambreuil
6 years ago
21 changed files with 348 additions and 209 deletions
-
12connector_voicent/__manifest__.py
-
4connector_voicent/data/ir_cron.xml
-
32connector_voicent/examples/prototype.py
-
2connector_voicent/examples/voicent.csv
-
52connector_voicent/examples/voicent.py
-
3connector_voicent/models/__init__.py
-
111connector_voicent/models/backend_voicent.py
-
109connector_voicent/models/backend_voicent_call_line.py
-
18connector_voicent/models/backend_voicent_time_line.py
-
17connector_voicent/models/queue_job.py
-
4connector_voicent/models/res_partner.py
-
6connector_voicent/readme/CONFIGURATION.rst
-
3connector_voicent/readme/ROADMAP.rst
-
4connector_voicent/readme/USAGE.rst
-
8connector_voicent/security/ir.model.access.csv
-
BINconnector_voicent/static/description/icon.png
-
13connector_voicent/tests/test_backend_voicent.py
-
18connector_voicent/view/queue_job_view.xml
-
55connector_voicent/views/backend_voicent.xml
-
76connector_voicent/views/backend_voicent_call_line.xml
-
10connector_voicent/views/res_partner.xml
@ -1,32 +0,0 @@ |
|||
# Copyright (C) 2019 Open Source Integrators |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
|||
|
|||
|
|||
# Simple message |
|||
import voicent |
|||
|
|||
|
|||
v = voicent.Voicent() |
|||
phoneno = "6024275632" |
|||
reqid = v.callText(phoneno, "Hello, This is a test of the autodialer.", "1") |
|||
status = v.callStatus(reqid) |
|||
|
|||
# Using Campaign in 2 steps |
|||
v = voicent.Voicent() |
|||
filepath = "/home/mchambreuil/odoo/pvm/voicent.csv" |
|||
listname = "Test" |
|||
leadsrc_id = v.importCampaign(listname, filepath) |
|||
res = v.runCampaign(listname) |
|||
v.checkStatus(res['leadsrc_id']) |
|||
|
|||
# Using Campaign in 1 step with TTS |
|||
v = voicent.Voicent() |
|||
filepath = "/home/mchambreuil/odoo/pvm/voicent.csv" |
|||
res = v.importAndRunCampaign(filepath, "tts", "Hello, This is a test. Bye") |
|||
status = v.checkStatus(res['camp_id']) |
|||
|
|||
# Using Campaign in 1 step with Template |
|||
v = voicent.Voicent() |
|||
filepath = "/home/mchambreuil/odoo/pvm/voicent.csv" |
|||
res = v.importAndRunCampaign(filepath, "template", "Test") |
|||
status = v.checkStatus(res['camp_id']) |
@ -1,2 +0,0 @@ |
|||
Name,Phone |
|||
Maxime Chambreuil,6024275632 |
@ -1,5 +1,6 @@ |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
|||
|
|||
from . import res_partner |
|||
from . import backend_voicent_call_line |
|||
from . import backend_voicent_time_line |
|||
from . import backend_voicent |
|||
from . import queue_job |
@ -0,0 +1,109 @@ |
|||
# Copyright (C) 2019 Open Source Integrators |
|||
# <https://www.opensourceintegrators.com> |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
|||
|
|||
from odoo import fields, models |
|||
|
|||
VOICENT_CONTACT_COLUMNS = [('First Name', 'First Name (Required)'), |
|||
('Last Name', 'Last Name'), |
|||
('Business', 'Business'), |
|||
('Phone', 'Phone (Required)'), |
|||
('Email', 'Email'), |
|||
('Category', 'Category'), |
|||
('Assigned To', 'Assigned To'), |
|||
('Contact Status', 'Contact Status'), |
|||
('Lead Source', 'Lead Source'), |
|||
('Other', 'Other')] |
|||
|
|||
VOICENT_REPLY = [('availableagents', 'Available Agents'), |
|||
('callback', 'Callback'), |
|||
('campid', 'Campaign ID'), |
|||
('campname', 'Campaign Name'), |
|||
('campsize', 'Campaign Size'), |
|||
('connected', 'Connected'), |
|||
('dnc', 'Contact DNC'), |
|||
('nophone', 'Contact No Phone'), |
|||
('disc', 'Disc. Number'), |
|||
('dropped', 'Dropped'), |
|||
('failed', 'Failed'), |
|||
('fax', 'Fax'), |
|||
('info', 'Info'), |
|||
('in', 'Interested'), |
|||
('lines', 'Lines'), |
|||
('linebusy', 'Line Busy'), |
|||
('live', 'Live Answer'), |
|||
('machine', 'Machine Answer'), |
|||
('made', 'Made'), |
|||
('maxlines', 'Max Lines'), |
|||
('noact', 'No Activity'), |
|||
('noanswer', 'No Answer'), |
|||
('notin', 'Not Interested'), |
|||
('notes', 'Notes'), |
|||
('optout', 'Opt Out'), |
|||
('serverr', 'Service Error'), |
|||
('status', 'Status'), |
|||
('totalagents', 'Total Agents'), |
|||
('wit', 'Wit')] |
|||
|
|||
MSGTYPE = [('audio', 'Audio'), |
|||
('ivr', 'IVR'), |
|||
('survey', 'Survey'), |
|||
('template', 'Template'), |
|||
('tts', 'Text-To-Speech')] |
|||
|
|||
|
|||
class BackendVoicentCallLine(models.Model): |
|||
_name = 'backend.voicent.call.line' |
|||
_description = 'Voicent Backend Call Line' |
|||
|
|||
name = fields.Char(string='Name', required=True) |
|||
sequence = fields.Integer(string='Sequence', default=0) |
|||
applies_on = fields.Selection(string='Applies on', selection=[]) |
|||
msgtype = fields.Selection(MSGTYPE, string='Message Type', required=True) |
|||
msginfo = fields.Char(string='Message Info') |
|||
backend_id = fields.Many2one( |
|||
string='Backend', |
|||
comodel_name='backend.voicent', |
|||
ondelete='set null') |
|||
reply_ids = fields.One2many('backend.voicent.call.line.reply', 'line_id', |
|||
string="Replies") |
|||
contact_ids = fields.One2many('backend.voicent.call.line.contact', |
|||
'line_id', |
|||
string="Contact Info") |
|||
|
|||
|
|||
class BackendVoicentCallLineContact(models.Model): |
|||
_name = 'backend.voicent.call.line.contact' |
|||
_description = 'Columns of the CSV file to provide the contact list' |
|||
_order = 'sequence' |
|||
|
|||
name = fields.Selection(VOICENT_CONTACT_COLUMNS, string='Voicent Field', |
|||
required=True) |
|||
other = fields.Char(string='Other') |
|||
sequence = fields.Integer(string='Sequence', default=0) |
|||
field_domain = fields.Char(string='Odoo Field', |
|||
required=True) |
|||
default_value = fields.Char(string='Default Value', required=True) |
|||
line_id = fields.Many2one( |
|||
string='Call Line', |
|||
comodel_name='backend.voicent.call.line', |
|||
ondelete='set null') |
|||
|
|||
|
|||
class BackendVoicentCallLineReply(models.Model): |
|||
_name = 'backend.voicent.call.line.reply' |
|||
_description = 'Reply to a Voicent Call' |
|||
|
|||
name = fields.Char(string='Name', required=True) |
|||
line_id = fields.Many2one( |
|||
string='Call Line', |
|||
comodel_name='backend.voicent.call.line', |
|||
ondelete='set null') |
|||
reply_field = fields.Selection(VOICENT_REPLY, string="Voicent Reply Field", |
|||
required=True) |
|||
reply_value = fields.Char(string="Voicent Reply Value", required=True) |
|||
action_id = fields.Many2one('ir.actions.server', string="Server Action", |
|||
required=True, |
|||
help="""If the Voicent reply field is equal to |
|||
the Voicent reply value, the server action is |
|||
executed.""") |
@ -0,0 +1,18 @@ |
|||
# Copyright (C) 2019 Open Source Integrators |
|||
# <https://www.opensourceintegrators.com> |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
|||
|
|||
from odoo import fields, models |
|||
|
|||
|
|||
class BackendVoicentTimeLine(models.Model): |
|||
_name = 'backend.voicent.time.line' |
|||
_description = 'Voicent Backend Time Line' |
|||
_order = 'time' |
|||
|
|||
name = fields.Char(string='Name', required=True) |
|||
time = fields.Float(string='Time', copy=False) |
|||
backend_id = fields.Many2one( |
|||
string='Backend', |
|||
comodel_name='backend.voicent', |
|||
ondelete='set null') |
@ -1,17 +0,0 @@ |
|||
# Copyright (C) 2019 Open Source Integrators |
|||
# <https://www.opensourceintegrators.com> |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
|||
|
|||
from odoo import fields, models |
|||
|
|||
|
|||
class QueueJob(models.Model): |
|||
""" Job status and result """ |
|||
_inherit = 'queue.job' |
|||
|
|||
call_line_id = fields.Many2one( |
|||
'backend.voicent.call.line', 'Call Line', |
|||
) |
|||
voicent_campaign = fields.Text( |
|||
'Campaign ID', |
|||
) |
@ -0,0 +1,6 @@ |
|||
#. Go to Settings > Users & Companies > Users |
|||
#. Select the filter "Inactive Users" only |
|||
#. Select the user "OdooBot" |
|||
#. Click on "Edit" |
|||
#. Go to the tab "Preferences" |
|||
#. Set the timezone |
@ -0,0 +1,3 @@ |
|||
* On the backend, replace the 'Applies On' selection list with a Many2one to ir.model.fields |
|||
* On the backend call line contact, use the domain widget to select the field |
|||
* Update the voicent library on Pypi with examples/voicent.py |
@ -1,4 +1,6 @@ |
|||
#. Go to Connectors > Backends > Voicent Backends |
|||
#. Create a new Voicent Backend with the host and port |
|||
#. Create a new Voicent Backend with the host, port, the caller ID and the number of lines |
|||
#. Create Call Lines to determine when (which stage in the process) calls are added to the queue |
|||
#. Create Contact Info to create the structure of the CSV file to send to Voicent |
|||
#. Create Replies to determine what to do based on the replies (see example below) |
|||
#. Create Time Line to determine when (what time) calls are made |
@ -1,4 +1,6 @@ |
|||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink |
|||
access_backend_voicent,access_backend_voicent,model_backend_voicent,base.group_user,1,1,1,1 |
|||
access_backend_voicent_call_line,access_backend_voicent_call_line,model_backend_voicent_call_line,base.group_user,1,1,1,1 |
|||
access_backend_voicent_time_line,access_backend_voicent_time_line,model_backend_voicent_time_line,base.group_user,1,1,1,1 |
|||
access_backend_voicent,access_backend_voicent,model_backend_voicent,connector.group_connector_manager,1,1,1,1 |
|||
access_backend_voicent_call_line,access_backend_voicent_call_line,model_backend_voicent_call_line,connector.group_connector_manager,1,1,1,1 |
|||
access_backend_voicent_call_line_reply,access_backend_voicent_call_line_reply,model_backend_voicent_call_line_reply,connector.group_connector_manager,1,1,1,1 |
|||
access_backend_voicent_call_line_contact,access_backend_voicent_call_line_contact,model_backend_voicent_call_line_contact,connector.group_connector_manager,1,1,1,1 |
|||
access_backend_voicent_time_line,access_backend_voicent_time_line,model_backend_voicent_time_line,connector.group_connector_manager,1,1,1,1 |
Before Width: 128 | Height: 128 | Size: 9.2 KiB After Width: 210 | Height: 76 | Size: 22 KiB |
@ -1,18 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
|
|||
<record id="view_queue_job_form_inherit_voicent" model="ir.ui.view"> |
|||
<field name="name">queue.job.form.inherit.voicent</field> |
|||
<field name="model">queue.job</field> |
|||
<field name="inherit_id" ref="queue_job.view_queue_job_form"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//group[1]" position="after"> |
|||
<group string="Connector Voicent"> |
|||
<field name="call_line_id"/> |
|||
<field name="voicent_campaign"/> |
|||
</group> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
|
|||
</odoo> |
@ -0,0 +1,76 @@ |
|||
<odoo> |
|||
|
|||
<record id="backend_voicent_call_line_tree_view" model="ir.ui.view"> |
|||
<field name="name">backend.voicent.call.line.tree.view</field> |
|||
<field name="model">backend.voicent.call.line</field> |
|||
<field name="arch" type="xml"> |
|||
<tree string="Voicent Backend Call Lines"> |
|||
<field name="name"/> |
|||
<field name="applies_on"/> |
|||
<field name="msgtype"/> |
|||
<field name="msginfo"/> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="backend_voicent_call_line_form_view" model="ir.ui.view"> |
|||
<field name="name">backend.voicent.call.line.form.view</field> |
|||
<field name="model">backend.voicent.call.line</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Voicent Backend Call Line"> |
|||
<sheet> |
|||
<div class="oe_title"> |
|||
<h1><field name="name" class="field_name" placeholder="Name of the call line..."/></h1> |
|||
</div> |
|||
<group> |
|||
<group id="main-left"> |
|||
<field name="applies_on"/> |
|||
<field name="msgtype"/> |
|||
<field name="msginfo"/> |
|||
</group> |
|||
<group id="main-right"> |
|||
</group> |
|||
</group> |
|||
<notebook> |
|||
<page string="Contact Info"> |
|||
<field name="contact_ids"> |
|||
<tree string="Contacts"> |
|||
<field name="sequence" widget="handle"/> |
|||
<field name="name"/> |
|||
<field name="other"/> |
|||
<field name="field_domain"/> |
|||
<field name="default_value"/> |
|||
</tree> |
|||
<form> |
|||
<field name="name"/> |
|||
<group> |
|||
<group> |
|||
<field name="other"/> |
|||
<field name="field_domain" |
|||
placeholder="partner_id.name or partner_id.phone"/> |
|||
</group> |
|||
<group> |
|||
<field name="sequence"/> |
|||
<field name="default_value"/> |
|||
</group> |
|||
</group> |
|||
</form> |
|||
</field> |
|||
</page> |
|||
<page string="Replies"> |
|||
<field name="reply_ids"> |
|||
<tree string="Replies" editable="top"> |
|||
<field name="name"/> |
|||
<field name="reply_field" string="If"/> |
|||
<field name="reply_value" string="contains"/> |
|||
<field name="action_id" string="Then, execute"/> |
|||
</tree> |
|||
</field> |
|||
</page> |
|||
</notebook> |
|||
</sheet> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
</odoo> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue