Browse Source

Merge pull request #41 from akretion/8.0-fix-bug-40

Fix bug #40 and update travis config
pull/46/head
Alexis de Lattre 10 years ago
parent
commit
2c7e9c5d5f
  1. 4
      .travis.yml
  2. 4
      base_phone/res_users_view.xml
  3. 5
      base_phone/wizard/number_not_found.py

4
.travis.yml

@ -17,9 +17,9 @@ install:
- git clone https://github.com/OCA/maintainer-quality-tools.git ${HOME}/maintainer-quality-tools - git clone https://github.com/OCA/maintainer-quality-tools.git ${HOME}/maintainer-quality-tools
- export PATH=${HOME}/maintainer-quality-tools/travis:${PATH} - export PATH=${HOME}/maintainer-quality-tools/travis:${PATH}
- travis_install_nightly - travis_install_nightly
- sudo pip install phonenumbers py-Asterisk gevent_psycopg2 gevent_socketio
- sudo pip install phonenumbers py-Asterisk
- hg clone http://bitbucket.org/anybox/web_action_request -b ${VERSION} ${HOME}/web_action_request - hg clone http://bitbucket.org/anybox/web_action_request -b ${VERSION} ${HOME}/web_action_request
- hg clone http://bitbucket.org/anybox/web_socketio ${HOME}/web_socketio
- hg clone http://bitbucket.org/anybox/bus_enhanced ${HOME}/bus_enhanced
script: script:
- travis_run_tests - travis_run_tests

4
base_phone/res_users_view.xml

@ -13,8 +13,8 @@
<field name="model">res.users</field> <field name="model">res.users</field>
<field name="inherit_id" ref="base.view_users_form"/> <field name="inherit_id" ref="base.view_users_form"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<notebook>
<page string="Telephony" name="phone" invisible="1" position="inside">
<notebook position="inside">
<page string="Telephony" name="phone" invisible="1">
<!-- Empty page, which will be used by other phone modules --> <!-- Empty page, which will be used by other phone modules -->
<group name="phone-preferences" string="Telephony Preferences"> <group name="phone-preferences" string="Telephony Preferences">
</group> </group>

5
base_phone/wizard/number_not_found.py

@ -60,8 +60,9 @@ class number_not_found(orm.TransientModel):
if not res: if not res:
res = {} res = {}
if res.get('calling_number'): if res.get('calling_number'):
convert = self.pool['phone.common']._generic_reformat_phonenumbers(
cr, uid, None, {'phone': res.get('calling_number')}, context=context)
convert = self.pool['res.partner']._generic_reformat_phonenumbers(
cr, uid, None, {'phone': res.get('calling_number')},
context=context)
parsed_num = phonenumbers.parse(convert.get('phone')) parsed_num = phonenumbers.parse(convert.get('phone'))
res['e164_number'] = phonenumbers.format_number( res['e164_number'] = phonenumbers.format_number(
parsed_num, phonenumbers.PhoneNumberFormat.INTERNATIONAL) parsed_num, phonenumbers.PhoneNumberFormat.INTERNATIONAL)

Loading…
Cancel
Save