openerp-dev-web team mailing list archive
-
openerp-dev-web team
-
Mailing list archive
-
Message #03535
lp:~openerp-dev/openobject-addons/trunk-contact-google-sync-yaml_test-uco into lp:~openerp-dev/openobject-addons/trunk-contact-google-sync
Ujjvala Collins (OpenERP) has proposed merging lp:~openerp-dev/openobject-addons/trunk-contact-google-sync-yaml_test-uco into lp:~openerp-dev/openobject-addons/trunk-contact-google-sync.
Requested reviews:
OpenERP R&D Team (openerp-dev)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-contact-google-sync-yaml_test-uco/+merge/51711
[ADD]
sync_google_contact: Added a yaml.
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-contact-google-sync-yaml_test-uco/+merge/51711
Your team OpenERP R&D Team is requested to review the proposed merge of lp:~openerp-dev/openobject-addons/trunk-contact-google-sync-yaml_test-uco into lp:~openerp-dev/openobject-addons/trunk-contact-google-sync.
=== modified file 'sync_google_contact/__openerp__.py'
--- sync_google_contact/__openerp__.py 2011-02-28 12:38:47 +0000
+++ sync_google_contact/__openerp__.py 2011-03-01 08:33:06 +0000
@@ -33,6 +33,7 @@
'wizard/google_contact_import_view.xml'
],
'demo_xml': [],
+ 'test': ['test/test_sync_google_contact.yml'],
'installable': True,
'active': False,
'certificate': '',
=== added directory 'sync_google_contact/test'
=== added file 'sync_google_contact/test/test_sync_google_contact.yml'
--- sync_google_contact/test/test_sync_google_contact.yml 1970-01-01 00:00:00 +0000
+++ sync_google_contact/test/test_sync_google_contact.yml 2011-03-01 08:33:06 +0000
@@ -0,0 +1,33 @@
+-
+ In order to test Importing contacts from any google account into OpenERP,
+ I use a gmail account and import the contact details.
+-
+ I create a record for the gmail account for which I want to import the contacts.
+-
+ !record {model: google.login.contact, id: google_login_contact_id0}:
+ user: testmail.openerp
+ password: openerptiny
+-
+ I login into that account.
+-
+ !python {model: google.login.contact}: |
+ self.check_login(cr, uid, [ref('google_login_contact_id0')], context)
+-
+ Now I select from which group I want to get the contact details and I want to create partner for all contacts.
+-
+ !record {model: synchronize.google.contact.import, id: synchronize_google_contact_import_id0}:
+ create_partner: create_all
+ group_name: all
+-
+ I import the contacts.
+-
+ !python {model: synchronize.google.contact.import}: |
+ self.import_contact(cr, uid, [ref('synchronize_google_contact_import_id0')], context)
+-
+ I check whether the contacts are created or not.
+-
+ !python {model: ir.model.data}: |
+ addr_ids = self.pool.get('res.partner.address').search(cr, uid, [])
+ data_ids = self.search(cr, uid, [('res_id','in',addr_ids),('model','=','res.partner.address'),('module','=','sync_google_contact')])
+ assert data_ids, 'Addresses not created !'
+
\ No newline at end of file
=== modified file 'sync_google_contact/wizard/google_contact_import.py'
--- sync_google_contact/wizard/google_contact_import.py 2011-03-01 05:17:33 +0000
+++ sync_google_contact/wizard/google_contact_import.py 2011-03-01 08:33:06 +0000
@@ -118,7 +118,7 @@
return {'type': 'ir.actions.act_window_close'}
return {
- 'name': _(obj.create_partner =='create_all' and 'Partner') or _('Contacts'),
+ 'name': _(obj.create_partner =='create_all' and 'Partners') or _('Contacts'),
'domain': "[('id','in', ["+','.join(map(str,ids))+"])]",
'view_type': 'form',
'view_mode': 'tree,form',
@@ -219,7 +219,7 @@
if data.get('partner_id') and not addres :
res['partner_id'] = data.get('partner_id')
addresss_obj.write(cr,uid,contact_ids,res,context=context)
- return {}
+ return {'type': 'ir.actions.act_window_close'}
synchronize_google_contact()
Follow ups