dram.me

Odoo用户模块数据迁移(未完成)

部分插件会对res_users追加字段,连皮肤插件也是如此,所以不能单纯全字段导入导出;

导出users时,首先通过active字段做第一层筛选;

和res_users关联的res_partner数据同样需要导出;

通过以下代码导出的数据,仍然不完整,这块暂时搁置,以后有实现再继续研究:

psql odoo-14.4-old odoo -c "update res_partner set write_uid = create_uid where active = true and id <> 2"

psql odoo-14.4-old odoo -c "copy (select * from res_partner where id = any(select partner_id from res_users where active = true and id <> 2)) to stdout" | psql odoo-14.4 odoo -c "copy res_partner from stdin"

psql odoo-14.4-old odoo -c "copy (select * from res_users where active = true and id <> 2) to stdout" | psql odoo-14.4 odoo -c "copy res_users from stdin"