Change Base field odoo 9

179 Views Asked by At

i need to import department data to my odoo database, for this odoo can't do this because ID field is read only, all forum tell that i must change this with python module, can you help me to resolve this problem, thank you

1

There are 1 best solutions below

0
On

my fiend i'm working on a case like yours now this question is not for forums this is a real work you need to create a copy of your database add the ids to every table and fix the relation between them when you finish take every thing to the postgres database :

add id to every table create many2one field in the new tables than fix it's values by the new id and the old primary key and foriegn key

      T1        One------To------Many          T2
    old_id                              old_forignkey_T1
     AE1                                   AE1

create copy of this table : add id and many2one_fields

  copy_T1                          copy_T2
  id    old_id                  old_forienkey_T1  many2one_field_id
  1      AE1                        AE1               null

fix the values of the many2one fields according to the id ,old_id ,old_forign key :

 1      AE1          ----->     AE1               1

this is really hard work good luck