Browse Source

Merge pull request #122 from kryskool/8.0

[8.0 ]Reproduce error message with contact us form in webiste_crm
pull/138/head
Alexis de Lattre 7 years ago
committed by GitHub
parent
commit
ba2ecf661c
  1. 4
      .travis.yml
  2. 2
      base_phone/base_phone.py
  3. 8
      base_phone/test/phonenum.yml

4
.travis.yml

@ -32,8 +32,8 @@ install:
- export PATH=${HOME}/maintainer-quality-tools/travis:${PATH}
- travis_install_nightly
- pip install phonenumbers py-Asterisk SOAPpy
- hg clone http://bitbucket.org/anybox/web_action_request -b ${VERSION} ${HOME}/web_action_request
- hg clone http://bitbucket.org/anybox/bus_enhanced ${HOME}/bus_enhanced
- hg clone http://bitbucket.org/anybox/web_action_request -b ${VERSION} ${HOME}/dependencies/web_action_request
- hg clone http://bitbucket.org/anybox/bus_enhanced ${HOME}/dependencies/bus_enhanced
script:
- travis_run_tests

2
base_phone/base_phone.py

@ -53,6 +53,8 @@ class PhoneCommon(models.AbstractModel):
user = self.pool['res.users'].browse(cr, uid, uid, context=context)
# country_id on res.company is a fields.function that looks at
# company_id.partner_id.addres(default).country_id
if self._country_field in vals and isinstance(vals[self._country_field], (str, unicode)):
vals[self._country_field] = int(vals[self._country_field])
countrycode = None
if self._country_field:
if vals.get(self._country_field):

8
base_phone/test/phonenum.yml

@ -48,3 +48,11 @@
assert name == 'Pierre Paillet', 'Wrong result for get_name_from_phone_number'
name2 = self.get_name_from_phone_number(cr, uid, '0041216191010')
assert name2 == u'Joël Grand-Guillaume (Camptocamp)', 'Wrong result for get_name_from_phone_number (partner2)'
-
Check country_id come from contact us form from website_crm module
-
!python {model: res.partner}: |
vals = self._generic_reformat_phonenumbers(cr, uid, [], {
'country_id': u'74', 'phone': u'0155667788'
}, context=context)
assert vals['phone'] == '+33155667788'
Loading…
Cancel
Save