Browse Source
Merge pull request #18 from akretion/8.0-fix-bug-17-no-raise
Merge pull request #18 from akretion/8.0-fix-bug-17-no-raise
Fix bug #17: don't raise by default on write/createpull/16/merge
Alexis de Lattre
10 years ago
8 changed files with 90 additions and 22 deletions
-
3asterisk_click2dial/asterisk_click2dial.py
-
1base_phone/__openerp__.py
-
27base_phone/base_phone.py
-
4base_phone/res_partner_view.xml
-
25base_phone/static/src/js/phone_widget.js
-
6base_phone/static/src/xml/phone.xml
-
37base_phone/test/phonenum.yml
-
9base_phone/wizard/reformat_all_phonenumbers.py
@ -0,0 +1,37 @@ |
|||||
|
- |
||||
|
Write french phone numbers in national format |
||||
|
- |
||||
|
!record {model: res.partner, id: partner1}: |
||||
|
name: Pierre Paillet |
||||
|
mobile: 06 42 77 42 66 |
||||
|
fax: (0) 1 45 42 12 42 |
||||
|
- |
||||
|
Write swiss phone numbers in international format |
||||
|
- |
||||
|
!record {model: res.partner, id: partner2}: |
||||
|
name: Joël Grand-Guillaume |
||||
|
parent_id: base.res_partner_12 |
||||
|
phone: +41 21 619 10 10 |
||||
|
mobile: +41 79 606 42 42 |
||||
|
- |
||||
|
Write invalid phone number |
||||
|
- |
||||
|
!record {model: res.partner, id: partner3}: |
||||
|
name: Jean Badphone |
||||
|
phone: 42 |
||||
|
- |
||||
|
Check that valid phone numbers have been converted to E.164 |
||||
|
- |
||||
|
!python {model: res.partner}: | |
||||
|
partner1 = self.browse(cr, uid, ref('partner1'), context=context) |
||||
|
assert partner1.mobile == '+33642774266', 'Mobile number not written in E.164 format (partner1)' |
||||
|
assert partner1.fax == '+33145421242', 'Fax number not written in E.164 format (partner1)' |
||||
|
partner2 = self.browse(cr, uid, ref('partner2'), context=context) |
||||
|
assert partner2.phone == '+41216191010', 'Phone number not written in E.164 format (partner2)' |
||||
|
assert partner2.mobile == '+41796064242', 'Mobile number not written in E.164 format (partner2)' |
||||
|
- |
||||
|
Check that invalid phone numbers are kept unchanged |
||||
|
- |
||||
|
!python {model: res.partner}: | |
||||
|
partner3 = self.browse(cr, uid, ref('partner3'), context=context) |
||||
|
assert partner3.phone == '42', 'Invalid phone numbers should not be changed' |
Write
Preview
Loading…
Cancel
Save
Reference in new issue