[FIX] base_contact migration to contact
authorAntony Lesuisse <al@openerp.com>
Wed, 15 Feb 2012 13:22:13 +0000 (14:22 +0100)
committerAntony Lesuisse <al@openerp.com>
Wed, 15 Feb 2012 13:22:13 +0000 (14:22 +0100)
lp bug: https://launchpad.net/bugs/927707 fixed

bzr revid: al@openerp.com-20120215132213-n8v4isg4ibftr15f

addons/base_contact/base_contact.py

index 7df5c44..59ac8a0 100644 (file)
@@ -44,7 +44,7 @@ class res_partner_contact(osv.osv):
         'lang_id': fields.many2one('res.lang', 'Language'),
         'job_ids': fields.one2many('res.partner.address', 'contact_id', 'Functions and Addresses'),
         'country_id': fields.many2one('res.country','Nationality'),
-        'birthdate': fields.date('Birth Date'),
+        'birthdate': fields.char('Birthdate', size=64),
         'active': fields.boolean('Active', help="If the active field is set to False,\
                  it will allow you to hide the partner contact without removing it."),
         'partner_id': fields.related('job_ids', 'partner_id', type='many2one',\
@@ -99,9 +99,9 @@ class res_partner_contact(osv.osv):
             cr.execute("""
                 INSERT INTO
                     res_partner_contact
-                    (id,name,last_name,title,active)
+                    (id,name,last_name,title,active,email,mobile,birthdate)
                 SELECT
-                    id,COALESCE(name, '/'),COALESCE(name, '/'),title,true
+                    id,COALESCE(name, '/'),COALESCE(name, '/'),title,true,email,mobile,birthdate
                 FROM
                     res_partner_address""")
             cr.execute("alter table res_partner_address add contact_id int references res_partner_contact")