diff --git a/asterisk_click2dial/asterisk_click2dial.py b/asterisk_click2dial/asterisk_click2dial.py index 9afc1a6..0cb21ad 100644 --- a/asterisk_click2dial/asterisk_click2dial.py +++ b/asterisk_click2dial/asterisk_click2dial.py @@ -115,12 +115,15 @@ class asterisk_server(osv.osv): ] - # This function is dedicated to the transformation of the number - # available in OpenERP to the number that Asterisk should dial. - # You may have to inherit this function in another module specific - # for your company if you are not happy with the way I reformat - # the OpenERP numbers. def reformat_number(self, cr, uid, ids, erp_number, ast_server, context): + ''' + This function is dedicated to the transformation of the number + available in OpenERP to the number that Asterisk should dial. + You may have to inherit this function in another module specific + for your company if you are not happy with the way I reformat + the OpenERP numbers. + ''' + logger = netsvc.Logger() error_title_msg = _("Invalid phone number") invalid_international_format_msg = _("The phone number is not written in valid international format. Example of valid international format : +33 1 41 98 12 42") @@ -184,9 +187,12 @@ class asterisk_server(osv.osv): logger.notifyChannel('asterisk_click2dial', netsvc.LOG_DEBUG, 'Out prefix = ' + out_prefix + ' - Number to be sent to Asterisk = ' + tmp_number) return tmp_number - # Open the socket to the Asterisk Manager Interface - # and send instructions to Dial to Asterisk def dial(self, cr, uid, ids, erp_number, context): + ''' + Open the socket to the Asterisk Manager Interface (AMI) + and send instructions to Dial to Asterisk. That's the important function ! + + ''' logger = netsvc.Logger() user = self.pool.get('res.users').browse(cr, uid, uid, context=context) @@ -269,12 +275,15 @@ class res_partner_address(osv.osv): _name = "res.partner.address" _inherit ="res.partner.address" - # Functions called by the button "Dial" in the partner address view def action_dial_phone(self, cr, uid, ids, context): + '''Function called by the button 'Dial' next to the 'phone' field + in the partner address view''' erp_number = self.read(cr, uid, ids, ['phone'], context=context)[0]['phone'] self.pool.get('asterisk.server').dial(cr, uid, ids, erp_number, context) def action_dial_mobile(self, cr, uid, ids, context): + '''Function called by the button 'Dial' next to the 'mobile' field + in the partner address view''' erp_number = self.read(cr, uid, ids, ['mobile'], context=context)[0]['mobile'] self.pool.get('asterisk.server').dial(cr, uid, ids, erp_number, context) diff --git a/asterisk_click2dial/asterisk_click2dial_demo.xml b/asterisk_click2dial/asterisk_click2dial_demo.xml index 495a67b..b9f8c1c 100644 --- a/asterisk_click2dial/asterisk_click2dial_demo.xml +++ b/asterisk_click2dial/asterisk_click2dial_demo.xml @@ -1,4 +1,12 @@ + + diff --git a/asterisk_click2dial/asterisk_server_view.xml b/asterisk_click2dial/asterisk_server_view.xml index bb2b077..d1a6add 100644 --- a/asterisk_click2dial/asterisk_server_view.xml +++ b/asterisk_click2dial/asterisk_server_view.xml @@ -1,7 +1,14 @@ + + + asterisk.server.company res.company @@ -16,6 +23,7 @@ + asterisk.server.form asterisk.server @@ -40,6 +48,7 @@ + asterisk.server.tree asterisk.server @@ -54,6 +63,7 @@ + Asterisk Servers asterisk.server diff --git a/asterisk_click2dial/i18n/fr_FR.po b/asterisk_click2dial/i18n/fr_FR.po index e8ca3f8..be2fbff 100644 --- a/asterisk_click2dial/i18n/fr_FR.po +++ b/asterisk_click2dial/i18n/fr_FR.po @@ -8,7 +8,7 @@ msgstr "" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2010-09-10 20:15:08+0000\n" "PO-Revision-Date: 2010-09-10 20:15:08+0000\n" -"Last-Translator: <>\n" +"Last-Translator: Alexis de Lattre \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff --git a/asterisk_click2dial/res_partner_view.xml b/asterisk_click2dial/res_partner_view.xml index b0937ae..c667dca 100644 --- a/asterisk_click2dial/res_partner_view.xml +++ b/asterisk_click2dial/res_partner_view.xml @@ -1,4 +1,13 @@ + + diff --git a/asterisk_click2dial/res_users_view.xml b/asterisk_click2dial/res_users_view.xml index 234e37b..97b2d3a 100644 --- a/asterisk_click2dial/res_users_view.xml +++ b/asterisk_click2dial/res_users_view.xml @@ -1,4 +1,12 @@ + + diff --git a/asterisk_click2dial/security/asterisk_server_security.xml b/asterisk_click2dial/security/asterisk_server_security.xml index e469f5f..9b7daa9 100644 --- a/asterisk_click2dial/security/asterisk_server_security.xml +++ b/asterisk_click2dial/security/asterisk_server_security.xml @@ -1,4 +1,11 @@ +