Browse Source
The regular "phone", "mobile" and "fax" fields now store the phone number in E164 format ; the special fields phone_e164, mobile_e164 and fax_164 are not used any more.
The regular "phone", "mobile" and "fax" fields now store the phone number in E164 format ; the special fields phone_e164, mobile_e164 and fax_164 are not used any more.
Add phone widget that handle the "nice" display of phone number to the user. IMPORTANT : you need to restart the wizard "Reformat all phone numbers" in order to put the "phone", "mobile" and "fax" fields in E164 format (without spaces).pull/7/head
Alexis de Lattre
12 years ago
14 changed files with 1459 additions and 92 deletions
-
5asterisk_click2dial/__openerp__.py
-
37asterisk_click2dial/asterisk_click2dial.py
-
24asterisk_click2dial/res_partner_view.xml
-
1318asterisk_click2dial/static/lib/js/PhoneFormat.js
-
33asterisk_click2dial/static/src/js/phone_widget.js
-
25asterisk_click2dial/static/src/xml/phone.xml
-
19asterisk_click2dial/wizard/reformat_all_phonenumbers_view.xml
-
1asterisk_click2dial_crm/__openerp__.py
-
17asterisk_click2dial_crm/asterisk_click2dial_crm.py
-
16asterisk_click2dial_crm/crm_lead_view.xml
-
26asterisk_click2dial_crm/crm_phonecall_view.xml
-
2asterisk_click2dial_crm_claim/crm_claim_view.xml
-
14asterisk_click2dial_registration/asterisk_click2dial_registration.py
-
14asterisk_click2dial_registration/registration_view.xml
1318
asterisk_click2dial/static/lib/js/PhoneFormat.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,33 @@ |
|||
// Base phone module for OpenERP
|
|||
// Copyright (C) 2013 Alexis de Lattre <alexis@via.ecp.fr>
|
|||
// The licence is in the file __openerp__.py
|
|||
|
|||
openerp.asterisk_click2dial = function (instance) { |
|||
|
|||
|
|||
instance.asterisk_click2dial.FieldPhone = instance.web.form.FieldChar.extend({ |
|||
template: 'FieldPhone', |
|||
initialize_content: function() { |
|||
this._super(); |
|||
var $button = this.$el.find('button'); |
|||
$button.click(this.on_button_clicked); |
|||
this.setupFocus($button); |
|||
}, |
|||
render_value: function() { |
|||
if (!this.get("effective_readonly")) { |
|||
this._super(); |
|||
} else { |
|||
var formatted_number = formatInternational('', this.get('value')) |
|||
this.$el.find('a') |
|||
.attr('href', 'callto:' + this.get('value')) |
|||
.text(formatted_number || ''); |
|||
} |
|||
}, |
|||
on_button_clicked: function() { |
|||
location.href = 'callto:' + this.get('value'); |
|||
} |
|||
}); |
|||
|
|||
instance.web.form.widgets.add('phone', 'instance.asterisk_click2dial.FieldPhone'); |
|||
|
|||
} |
@ -0,0 +1,25 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<!-- |
|||
Base phone module for OpenERP |
|||
Copyright (C) 2013 Alexis de Lattre <alexis@via.ecp.fr> |
|||
The licence is in the file __openerp__.py |
|||
--> |
|||
|
|||
<templates id="template" xml:space="preserve"> |
|||
<t t-name="FieldPhone"> |
|||
<span class="oe_form_field oe_form_field_email" t-att-style="widget.node.attrs.style"> |
|||
<a t-if="widget.get('effective_readonly')" href="#" class="oe_form_uri" target="_blank"/> |
|||
<t t-if="!widget.get('effective_readonly')"> |
|||
<div> |
|||
<input type="text" |
|||
t-att-id="widget.id_for_label" |
|||
t-att-tabindex="widget.node.attrs.tabindex" |
|||
t-att-autofocus="widget.node.attrs.autofocus" |
|||
t-att-placeholder="widget.node.attrs.placeholder" |
|||
t-att-maxlength="widget.field.size" |
|||
/> |
|||
</div> |
|||
</t> |
|||
</span> |
|||
</t> |
|||
</templates> |
@ -0,0 +1,26 @@ |
|||
<?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> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue