I have some problem for backup and restore database using python for OpenERP. I would like to backup sale_order table and related tables for this. But... I don't know how to restore that backup file because there have some related keys (foreign key) vice visa..
e.g. I have backup file for sale_order that related tables like this:
insert into sale_order ....
insert into sale_order_line ...
that time, I have error for sale_order_line because sale_order_line have foreign key for procurement_order's id ... so I changed
insert into sale_order...
insert into procurement_order...
insert into sale_order_line...
but ... I've an error at procurement_order for foreign key for stock_move's id... so I changed again...
insert into sale_order...
insert into stock_move...
insert into procurement_order...
insert into sale_order_line...
but... it's still not OK :( because stock_move have foreign key of sale_order_line'id... I don't know how to do...
That's why... What is the best solution for this backup and restore for that case? If you have any idea, please give me. Thanks.