Browse Source
The "Dial" button is now inside the phone widget : this is great because it avoids the double inherit of views with phone fields (4 view XML files are removed in asterisk_click2dial* modules thanks to this !)
The "Dial" button is now inside the phone widget : this is great because it avoids the double inherit of views with phone fields (4 view XML files are removed in asterisk_click2dial* modules thanks to this !)
The "Open Calling Partner" feature is now located in the top right menu, next to the Preferences (instead of the Sales menu) A click on tel: and fax: links doesn't open a new tab any more Update description and copyrights of asterisk_click2dial_crmpull/7/head
Alexis de Lattre
10 years ago
24 changed files with 269 additions and 364 deletions
-
4asterisk_click2dial/__openerp__.py
-
101asterisk_click2dial/asterisk_click2dial.py
-
70asterisk_click2dial/res_partner_view.xml
-
27asterisk_click2dial/static/src/css/asterisk_click2dial.css
-
44asterisk_click2dial/static/src/js/asterisk_click2dial.js
-
26asterisk_click2dial/static/src/xml/asterisk_click2dial.xml
-
10asterisk_click2dial/wizard/open_calling_partner_view.xml
-
4asterisk_click2dial_crm/__init__.py
-
9asterisk_click2dial_crm/__openerp__.py
-
46asterisk_click2dial_crm/asterisk_click2dial_crm.py
-
57asterisk_click2dial_crm/crm_lead_view.xml
-
26asterisk_click2dial_crm/crm_phonecall_view.xml
-
2asterisk_click2dial_crm/wizard/create_crm_phonecall.py
-
9asterisk_click2dial_crm/wizard/open_calling_partner_view.xml
-
1asterisk_click2dial_crm_claim/__openerp__.py
-
29asterisk_click2dial_crm_claim/crm_claim_view.xml
-
2asterisk_click2dial_event/__openerp__.py
-
47asterisk_click2dial_event/registration_view.xml
-
1base_phone/__init__.py
-
2base_phone/__openerp__.py
-
5base_phone/base_phone.py
-
35base_phone/controller.py
-
63base_phone/static/src/js/phone_widget.js
-
13base_phone/static/src/xml/phone.xml
@ -1,70 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<!-- |
|||
Asterisk Click2dial module for Odoo/OpenERP |
|||
Copyright (C) 2010-2014 Alexis de Lattre <alexis@via.ecp.fr> |
|||
The licence is in the file __openerp__.py |
|||
|
|||
Inherit partner views to add 'Dial' button next to 'phone' |
|||
and 'mobile' fields |
|||
--> |
|||
|
|||
<openerp> |
|||
<data> |
|||
|
|||
<record id="asterisk_res_partner_simplified_form_dial" model="ir.ui.view"> |
|||
<field name="name">asterisk.res.partner.simplified.form.dial</field> |
|||
<field name="model">res.partner</field> |
|||
<field name="priority">15</field> |
|||
<field name="inherit_id" ref="base_phone.view_partner_simple_form"/> |
|||
<field name="arch" type="xml"> |
|||
<field name="phone" position="replace"> |
|||
<group colspan="2" col="8"> |
|||
<field name="phone" widget="phone" colspan="7" /> |
|||
<button name="action_dial" context="{'field2dial': 'phone'}" string="Dial" type="object" attrs="{'invisible':[('phone','=',False)]}"/> |
|||
</group> |
|||
</field> |
|||
<field name="mobile" position="replace"> |
|||
<group colspan="2" col="8"> |
|||
<field name="mobile" widget="phone" colspan="7" /> |
|||
<button name="action_dial" context="{'field2dial': 'mobile'}" string="Dial" type="object" attrs="{'invisible':[('mobile','=',False)]}"/> |
|||
</group> |
|||
</field> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="asterisk_res_partner_form_dial" model="ir.ui.view"> |
|||
<field name="name">asterisk.res.partner.form.dial</field> |
|||
<field name="model">res.partner</field> |
|||
<field name="priority">15</field> |
|||
<field name="inherit_id" ref="base_phone.view_partner_form"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//group/group/field[@name='phone']" position="replace"> |
|||
<group colspan="2" col="8"> |
|||
<field name="phone" widget="phone" colspan="7" /> |
|||
<button name="action_dial" context="{'field2dial': 'phone'}" string="Dial" type="object" attrs="{'invisible':[('phone','=',False)]}"/> |
|||
</group> |
|||
</xpath> |
|||
<xpath expr="//group/group/field[@name='mobile']" position="replace"> |
|||
<group colspan="2" col="8"> |
|||
<field name="mobile" widget="phone" colspan="7" /> |
|||
<button name="action_dial" context="{'field2dial': 'mobile'}" string="Dial" type="object" attrs="{'invisible':[('mobile','=',False)]}"/> |
|||
</group> |
|||
</xpath> |
|||
<xpath expr="//form[@string='Contact']/sheet/group/field[@name='phone']" position="replace"> |
|||
<group colspan="2" col="8"> |
|||
<field name="phone" widget="phone" colspan="7" /> |
|||
<button name="action_dial" context="{'field2dial': 'phone'}" string="Dial" type="object" attrs="{'invisible':[('phone','=',False)]}"/> |
|||
</group> |
|||
</xpath> |
|||
<xpath expr="//form[@string='Contact']/sheet/group/field[@name='mobile']" position="replace"> |
|||
<group colspan="2" col="8"> |
|||
<field name="mobile" widget="phone" colspan="7" /> |
|||
<button name="action_dial" context="{'field2dial': 'mobile'}" string="Dial" type="object" attrs="{'invisible':[('mobile','=',False)]}"/> |
|||
</group> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
|
|||
|
|||
</data> |
|||
</openerp> |
@ -0,0 +1,27 @@ |
|||
/* |
|||
Asterisk Click2dial module for OpenERP |
|||
Copyright (C) 2014 Alexis de Lattre <alexis@via.ecp.fr> |
|||
The licence is in the file __openerp__.py |
|||
*/ |
|||
|
|||
.openerp .oe_topbar_item.oe_topbar_open_calling_partner{ |
|||
padding: 0px; |
|||
width: 32px; |
|||
height: 32px; |
|||
} |
|||
|
|||
.openerp .oe_topbar_item.oe_topbar_open_calling_partner button{ |
|||
position: relative; |
|||
top: -3px; |
|||
box-sizing: border-box; |
|||
border: none; |
|||
box-shadow: none; |
|||
color: white; |
|||
background: none; |
|||
text-shadow: 0px 1px 2px black; |
|||
width: 32px; |
|||
height: 32px; |
|||
padding: 0px; |
|||
margin: 0px |
|||
border-radius: 0px; |
|||
} |
@ -0,0 +1,44 @@ |
|||
/* Asterisk_click2dial module for OpenERP |
|||
Copyright (C) 2014 Alexis de Lattre <alexis@via.ecp.fr> |
|||
The licence is in the file __openerp__.py */ |
|||
|
|||
openerp.asterisk_click2dial = function (instance) { |
|||
|
|||
var _t = instance.web._t; |
|||
|
|||
instance.web.OpenCallingPartner = instance.web.Widget.extend({ |
|||
template:'asterisk_click2dial.OpenCallingPartner', |
|||
|
|||
start: function () { |
|||
this.$('button').on('click', this.on_open_calling_partner); |
|||
this._super(); |
|||
}, |
|||
|
|||
on_open_calling_partner: function (event) { |
|||
event.stopPropagation(); |
|||
var action = { |
|||
name: _t('Open Calling Partner'), |
|||
type: 'ir.actions.act_window', |
|||
res_model: 'wizard.open.calling.partner', |
|||
view_mode: 'form', |
|||
views: [[false, 'form']], |
|||
target: 'new', |
|||
context: {}, |
|||
}; |
|||
instance.client.action_manager.do_action(action); |
|||
}, |
|||
}); |
|||
|
|||
instance.web.UserMenu.include({ |
|||
do_update: function(){ |
|||
this._super.apply(this, arguments); |
|||
this.update_promise.then(function() { |
|||
var asterisk_button = new instance.web.OpenCallingPartner(); |
|||
asterisk_button.appendTo(instance.webclient.$el.find('.oe_systray')); |
|||
}); |
|||
}, |
|||
}); |
|||
|
|||
}; |
|||
|
|||
|
@ -0,0 +1,26 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!-- |
|||
Asterisk Click2dial module for OpenERP |
|||
Copyright (C) 2014 Alexis de Lattre <alexis@via.ecp.fr> |
|||
The licence is in the file __openerp__.py |
|||
--> |
|||
|
|||
<template> |
|||
|
|||
<!-- Add phone button in top right menu for "Open Calling Partner" --> |
|||
<t t-name="asterisk_click2dial.OpenCallingPartner"> |
|||
<div title="Open Calling Partner" |
|||
class="oe_topbar_item oe_topbar_open_calling_partner"> |
|||
<button class="oe_i">A</button> |
|||
<!-- oe_i is a special icon font : 'A' represents a phone --> |
|||
</div> |
|||
</t> |
|||
|
|||
<!-- Add Dial button in phone widget for click2dial feature --> |
|||
<t t-extend="FieldPhone"> |
|||
<t t-jquery="a.oe_form_uri" t-operation="after"> |
|||
<a id="click2dial" href="#" class="oe_bold"/> |
|||
</t> |
|||
</t> |
|||
|
|||
</template> |
@ -1,57 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<!-- |
|||
Asterisk Click2dial module for OpenERP |
|||
Copyright (C) 2010-2013 Alexis de Lattre <alexis@via.ecp.fr> |
|||
Copyright (C) 2010-2013 Invitu <contact@invitu.com> |
|||
The licence is in the file __openerp__.py |
|||
|
|||
Inherit lead views to add 'Dial' button next to 'phone' |
|||
and 'mobile' fields |
|||
--> |
|||
|
|||
<openerp> |
|||
<data> |
|||
|
|||
<record id="asterisk_crm_lead_simplified_form_dial" model="ir.ui.view"> |
|||
<field name="name">asterisk.crm_lead.form.dial</field> |
|||
<field name="model">crm.lead</field> |
|||
<field name="inherit_id" ref="crm.crm_case_form_view_leads"/> |
|||
<field name="arch" type="xml"> |
|||
<field name="phone" position="replace"> |
|||
<group colspan="2" col="8"> |
|||
<field name="phone" widget="phone" colspan="7" /> |
|||
<button name="action_dial" context="{'field2dial': 'phone'}" string="Dial" type="object" attrs="{'invisible':[('phone','=',False)]}"/> |
|||
</group> |
|||
</field> |
|||
<field name="mobile" position="replace"> |
|||
<group colspan="2" col="8"> |
|||
<field name="mobile" widget="phone" colspan="7" /> |
|||
<button name="action_dial" context="{'field2dial': 'mobile'}" string="Dial" type="object" attrs="{'invisible':[('mobile','=',False)]}"/> |
|||
</group> |
|||
</field> |
|||
</field> |
|||
</record> |
|||
|
|||
|
|||
<record id="asterisk_crm_case_form_view_oppor_dial" model="ir.ui.view"> |
|||
<field name="name">asterisk.crm_case.form.view_oppor.dial</field> |
|||
<field name="model">crm.lead</field> |
|||
<field name="inherit_id" ref="crm.crm_case_form_view_oppor"/> |
|||
<field name="arch" type="xml"> |
|||
<field name="phone" position="replace"> |
|||
<group colspan="2" col="8"> |
|||
<field name="phone" widget="phone" colspan="7" /> |
|||
<button name="action_dial" context="{'field2dial': 'phone'}" string="Dial" type="object" attrs="{'invisible':[('phone','=',False)]}"/> |
|||
</group> |
|||
</field> |
|||
<field name="mobile" position="replace"> |
|||
<group colspan="2" col="8"> |
|||
<field name="mobile" widget="phone" colspan="7" /> |
|||
<button name="action_dial" context="{'field2dial': 'mobile'}" string="Dial" type="object" attrs="{'invisible':[('mobile','=',False)]}"/> |
|||
</group> |
|||
</field> |
|||
</field> |
|||
</record> |
|||
|
|||
</data> |
|||
</openerp> |
@ -1,26 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<!-- |
|||
Asterisk Click2dial module for OpenERP |
|||
Copyright (C) 2013 Alexis de Lattre <alexis@via.ecp.fr> |
|||
The licence is in the file __openerp__.py |
|||
--> |
|||
|
|||
<openerp> |
|||
<data> |
|||
|
|||
<record id="asterisk_crm_phonecall_form_view" model="ir.ui.view"> |
|||
<field name="name">asterisk.crm_phonecall_form_view</field> |
|||
<field name="model">crm.phonecall</field> |
|||
<field name="inherit_id" ref="crm.crm_case_phone_form_view"/> |
|||
<field name="arch" type="xml"> |
|||
<field name="partner_phone" position="attributes"> |
|||
<attribute name="widget">phone</attribute> |
|||
</field> |
|||
<field name="partner_mobile" position="attributes"> |
|||
<attribute name="widget">phone</attribute> |
|||
</field> |
|||
</field> |
|||
</record> |
|||
|
|||
</data> |
|||
</openerp> |
@ -1,29 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<!-- |
|||
Asterisk Click2dial CRM Claim module for OpenERP |
|||
Copyright (C) 2013 Invitu <contact@invitu.com> |
|||
The licence is in the file __openerp__.py |
|||
|
|||
Inherit crm_claim view to add 'Dial' button next to 'phone' |
|||
field |
|||
--> |
|||
|
|||
<openerp> |
|||
<data> |
|||
|
|||
<record id="asterisk_crm_claim_form_dial" model="ir.ui.view"> |
|||
<field name="name">asterisk.crm_claim.form.dial</field> |
|||
<field name="model">crm.claim</field> |
|||
<field name="inherit_id" ref="crm_claim_phone.crm_case_claims_form_view"/> |
|||
<field name="arch" type="xml"> |
|||
<field name="partner_phone" position="replace"> |
|||
<group colspan="2" col="3"> |
|||
<field name="partner_phone" colspan="2" widget="phone"/> |
|||
<button name="action_dial" context="{'field2dial': 'partner_phone'}" string="Dial" type="object" attrs="{'invisible':[('partner_phone','=',False)]}"/> |
|||
</group> |
|||
</field> |
|||
</field> |
|||
</record> |
|||
|
|||
</data> |
|||
</openerp> |
@ -1,47 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<!-- |
|||
Asterisk Click2dial CRM Claim module for OpenERP |
|||
Copyright (C) 2013 Invitu <contact@invitu.com> |
|||
The licence is in the file __openerp__.py |
|||
|
|||
Inherit event registration view to add 'Dial' button next to 'phone' |
|||
field |
|||
--> |
|||
|
|||
<openerp> |
|||
<data> |
|||
|
|||
<record id="view_event_registration_form" model="ir.ui.view"> |
|||
<field name="name">asterisk.event.registration.form.dial</field> |
|||
<field name="model">event.registration</field> |
|||
<field name="inherit_id" ref="event_phone.view_event_registration_form"/> |
|||
<field name="arch" type="xml"> |
|||
<field name="phone" position="replace"> |
|||
<group colspan="2" col="3"> |
|||
<field name="phone" widget="phone" colspan="2" /> |
|||
<button name="action_dial" context="{'field2dial': 'phone'}" string="Dial" type="object" attrs="{'invisible':[('phone','=',False)]}"/> |
|||
</group> |
|||
</field> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="view_event_form" model="ir.ui.view"> |
|||
<field name="name">asterisk.event.form.registration.tree.dial</field> |
|||
<field name="model">event.event</field> |
|||
<field name="inherit_id" ref="event_phone.view_event_form"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//field[@name='registration_ids']/tree/field[@name='phone']" position="replace"> |
|||
<field name="phone" colspan="2" /> |
|||
<button name="action_dial" context="{'field2dial': 'phone'}" string="Dial" type="object" icon="terp-call-start" attrs="{'invisible':[('phone','=',False)]}"/> |
|||
</xpath> |
|||
<xpath expr="//field[@name='registration_ids']/form//field[@name='phone']" position="replace"> |
|||
<group colspan="2" col="3"> |
|||
<field name="phone" widget="phone" colspan="2" /> |
|||
<button name="action_dial" context="{'field2dial': 'phone'}" string="Dial" type="object" attrs="{'invisible':[('phone','=',False)]}"/> |
|||
</group> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
|
|||
</data> |
|||
</openerp> |
@ -0,0 +1,35 @@ |
|||
# -*- encoding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Asterisk click2dial module for OpenERP |
|||
# Copyright (C) 2014 Alexis de Lattre (alexis@via.ecp.fr) |
|||
# |
|||
# This program is free software: you can redistribute it and/or modify |
|||
# it under the terms of the GNU Affero General Public License as |
|||
# published by the Free Software Foundation, either version 3 of the |
|||
# License, or (at your option) any later version. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU Affero General Public License for more details. |
|||
# |
|||
# You should have received a copy of the GNU Affero General Public License |
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
|
|||
import openerp |
|||
|
|||
|
|||
class BasePhoneController(openerp.addons.web.http.Controller): |
|||
_cp_path = '/base_phone' |
|||
|
|||
@openerp.addons.web.http.jsonrequest |
|||
def click2dial(self, req, phone_number, click2dial_model, click2dial_id): |
|||
res = req.session.model('phone.common').click2dial( |
|||
phone_number, { |
|||
'click2dial_model': click2dial_model, |
|||
'click2dial_id': click2dial_id, |
|||
}) |
|||
return res |
Write
Preview
Loading…
Cancel
Save
Reference in new issue